php - How do you update a portion of an html page when submitting a form on selecting a checkbox? -


i have following code:

<?php      if(isset($_post['mycheckbox']))     {         //checkbox1 selected         echo "helloword 1: [".$office."]";         $checked = "checked";      }      else     {        //alternate code        echo "helloword 2: [".$office."]";        $checked = "";     } ?>  <form name="checkbox" action="<?php echo $_server['php_self']; ?>" method="post">     <input type="checkbox" name="mycheckbox" value="<?php echo $office;?>" onclick='submit();' <?php echo $checked;?>> </form> 

how update portion of html page when submitting form whole page doesn't reload? best way it?

i think ajax suit you, jquery.form plugin, can submit form use plugin without refreshing page.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -