Hello,
I have a form with one hidden field and one submit button, added manually. Then Ive added a multi record loader that loads data from the database. Then in the Custom Code action, I add one checkbox and one textbox for every line displayed from the database. When clicking submit button, Ive added in the code so that it displays what is inside $_POST, and I only get the values from the hidden field and submit button, but no values are passed from the checkboxes and textboxes into $_POST.
I am not a very experienced programmer, so I need some help to know where I can get these values from. I've tried using the form->data as well to get the information but with no luck.
Here is the code I've used in my custom code action, just above the show html action:
You will see I've set the "name" of the textboxes to "newtracks[]" because it will be an array of data to be sent through. Then the code I've added inside chronoforms.php is as follows:
For now, I just want to see what is inside $_POST and I don't get the values from those textboxes in $_POST and I'm not sure why.
Please assist, let me know if you need more details.
Thanks
Lindy
I have a form with one hidden field and one submit button, added manually. Then Ive added a multi record loader that loads data from the database. Then in the Custom Code action, I add one checkbox and one textbox for every line displayed from the database. When clicking submit button, Ive added in the code so that it displays what is inside $_POST, and I only get the values from the hidden field and submit button, but no values are passed from the checkboxes and textboxes into $_POST.
I am not a very experienced programmer, so I need some help to know where I can get these values from. I've tried using the form->data as well to get the information but with no luck.
Here is the code I've used in my custom code action, just above the show html action:
<table border=1 frame=below rules=rows>
<tr>
<td width="80"><font style="color:black">DATE</font></td>
<td width="30">USER</td>
<td width="200">TRACK NAME</td>
<td width="150">MP3 NAME</td>
<td width="80">STATUS</td>
</tr>
<tr>
<td width="80"><font style="color:black">DATE</font></td>
<td width="30">USER</td>
<td width="200">TRACK NAME</td>
<td width="150">MP3 NAME</td>
<td width="80">STATUS</td>
</tr>
<tr>
<td width="80"><font style="color:black">DATE</font></td>
<td width="30">USER</td>
<td width="200">TRACK NAME</td>
<td width="150">MP3 NAME</td>
<td width="80">STATUS</td>
</tr>
<?php
foreach($form->data['TrackStatus'] as $detail):
?>
<tr>
<td width="80"><?php echo $detail['cf_created']; ?></td>
<td width="30"><?php echo $detail['cf_user_id']; ?></td>
<td width="200"><?php echo $detail['Approved_Trackname_0']; ?></td>
<td width="150"><?php echo $detail['mp3_upload_21']; ?></td>
<td width="80"><?php echo $detail['Track_Status_0']; ?></td>
<td><input type="checkbox" name="onsite" id="onsite[]"></td>
<td><input type="text" size="30" name="newtracks[]" value="<?php echo $detail['cf_id'] ?>"/></td>
</tr>
<?php
endforeach;
?>
</table>
You will see I've set the "name" of the textboxes to "newtracks[]" because it will be an array of data to be sent through. Then the code I've added inside chronoforms.php is as follows:
if($event=='submit' && $form->form_details->id == $uploadstatus){
$app = JFactory::getApplication();
print_r ($_POST['newtracks']);
}
For now, I just want to see what is inside $_POST and I don't get the values from those textboxes in $_POST and I'm not sure why.
Please assist, let me know if you need more details.
Thanks
Lindy