javascript - retaining checkbox and POP Up to add more -


i have made form in person puts details. after completing form , submitting it, want popup should ask "do want add more?","yes or no ?". if yes chosen, values filled in form should retained , rest should appear blank. on no page should freshened blank. able retain values of drop down items , text fields,but not able retain values of check box items. check box code :

  <label>hotel facilities</label>     </td><td class="row1"> :</td>                                                           <td class="row1" width="70%">     <div style=" font-weight:normal; color: #4b4b4b;font-size: 12px; width:260px; background:#d2d2d2; max-height:300px; overflow:scroll;overflow-x:hidden;"> <?php $dcs=mysql_query("select * `tblfacility` `type`='rm'");                    while($dc=mysql_fetch_array($dcs)){?>                              <input type="checkbox" name="check_list[]" value="<?php echo $dc['fid']; ?>"> <?php echo $dc['facility'];?> <br />                      <?php  }?>                     </div> 

i tried retain using:

<input name="check_list[]" type="checkbox" value="<?php echo $dc['fid']; ?>" <?php if(isset($_post['check_list[]'])) echo "checked='checked'"; else echo $dc['facility']; ?> 

but did not worked

please me how retain values after submitting page.

and pop @ present using alert message , hence have ok button:

<?php      if(isset($_post['submit'])){         echo "<script>alert ('do want add more ?');</script>";     $hid=$_post['hid'];     ?> 

hence showing ok button after submitting . please guide how put yes or no button after submitting hence yes values retained , if no whole refreshed.

instead of checked='checked' use "selected" or "selected=true". hope works!


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -