php - Working with checkbox which is creating by Ajax -
i working ajax project. have form of user in name, address , postcode . on entering name, address or postcode matching rows shown ajax file in .
so on select checkbox want further activity.
my html code
address : <input type="text" name="user_name" id="from_location" value="" class="in_form" /> <div id="user"></div>
and jquery code is
$.ajax({ url: "ajax_user.php", data: { address: address, }, datatype: "html", type: "post", success: function(result){ $("#user").append(result); } }) }
and ajax user php
$sql= "select * instructor_mst sex='$sex' , car_type='$car_type' , address '%$address%' "; if (!$sqli=mysql_query($sql)){ echo mysql_error(); } $num_rows= mysql_num_rows($sqli); if($num_rows != 0) {?> <table border="0" class="form_ins" > <? while ($row = mysql_fetch_array($sqli)) { ?> <tr> <td> </td> <td> name </td> <td> address </td> </tr> <tr> <td> <input type="checkbox" name="select" value"<?php echo $row['id'];?>"> </td> <td> <?php echo $row['name'];?> </td> <td> <?php echo $row['address'];?> </td> </tr> </table <?}
in result got like
checkbox | user name | address
now on selecting checkbox want submit other activity.... not getting how can this...all answer appreicieted
as checkbox being dynamically added -
$(document).on('change','input[type=checkbox]',function(){ if($(this).is(':checked')){ // } });
or if have id of checkbox -
$(document).on('change','#checkboxid',function(){ if($(this).is(':checked')){ // } });
Comments
Post a Comment