html - How to make complex form on table and avoid nesting <form> elements -
i'm going ask stupidest question you've ever heard (shame on me). want make write markup table should this:
============================================================ | layout | date edited | actions | active | default | ============================================================ | lauout1 | 04.05.2012 |[delete] | [ ] | o | ...
fourth , fifth columns contain check box , radio button correspondingly , third got button. button submission should proceed 1 page on site , check box radio - other one. according question can't place 1 element inside one! mean 1 global around whole table , 1 around each delete button. think i'm going awful.. right solution?
you still can use 1 form element whole table inside it, , put many submit buttons deletes want. name of each button sent script value on it. example:
<form method="post"> <!-- table ... --> <!-- first item ... --> <input type="submit" value="delete" name="delete1" /> <!-- second item ... --> <input type="submit" value="delete" name="delete2" /> <!-- ... --> </form>
clicking different buttons post button pressed, can parse id see button pressed.
on following php script, if press first delete button saw before, like:
<?php isset($_post["delete1"]); //true isset($_post["delete2"]); //false ?>
for checkboxes , option items use input arrays:
<input type="checkbox" name="check[]" value="firstitemid" /> <input type="checkbox" name="check[]" value="seconditemid" />
on php code receive array on $_post['check']
i want recommend read cross-site request forgery
Comments
Post a Comment