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
Post a Comment