Hi,
There is an array whose length varies dynamically on the users input, I have to provide checkboxes for this array along with the value of the array and based on the checkboxes selected by the user the value of that checkbox has to be retrived back at the php code for further processing.
NOTE:The value of the array x changes dynamically, here it is 3, it can even be more or less than that.
Javascript code:
Can somebody please help me with this??
Thanks
There is an array whose length varies dynamically on the users input, I have to provide checkboxes for this array along with the value of the array and based on the checkboxes selected by the user the value of that checkbox has to be retrived back at the php code for further processing.
NOTE:The value of the array x changes dynamically, here it is 3, it can even be more or less than that.
Code:
<?
$x=array('a','b','c');
for($i=0;$i<count($x);$i++) {
echo "<input type='checkbox' id='chk[$i]' onclick=\"list_array($x[$i]\" />$x[$i]<br>";
}
Code:
function list_array(x) {
Here I have to collect all the values of array for which the checkbox is clicked and later return all the elements of the array back to the php function.
}
Thanks
Comment