jeudi 26 juillet 2018

can we hide and show child checkbox when click on specific parent checkbox

I want to display specific child checkbox when click on parent checkbox but the value of checkbox is come from database column

 <input name="service[]" type="checkbox" value="<?php echo $service['id']; ?>" id="" />

<?php 
echo $service['servicename'];
echo "<br>";
?>

<br><br>

<?php foreach ($activities as $activity) : ?>

    <input name="activity[]" type="checkbox" value="<?php echo $activity['id']; ?>" />

    <?php 
    echo $activity['nameofactivity'];
    echo "<br>"; 

My Output:

  • 1.Incometax
  • Return
  • Filling
  • 2.GST
  • Form
  • submitform

I want to display Return and Flling [activity of 1 st service] when click on Incometax[1 st service]and display Form and submitform[activity of 2 nd service] when click on [2nd service ]GST. but when click on incometax[1 st service] then hide Form and submitform[activity of second if opens] and when i click on GST[2 nd service] then hide Return and Filling [activity of 1 st service if opens]

Thanks.




Aucun commentaire:

Enregistrer un commentaire