I have a form as show by the following code in HTML 5.
<form name='removeTen' method='POST' action='notRemove.php'>
<table id='tender'>
<thead>
<tr><th></th>
<th><input id='selectAll' type='checkbox'></th>
<th>Notice Title</th>
<th>Edit </th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td><input type="checkbox" name="ten[]" value="1"</td>
<td>somedata1</td>
<td><input type = 'button' value = 'Edit' name ='1' ></td>
</tr>
<tr>
<td>2</td>
<td><input type="checkbox" name="ten[]" value="2"</td>
<td>somedata1</td>
<td><input type = 'button' value = 'Edit' name ='2' ></td>
</tr>
</tbody></table><p><input type=reset value='Reset'>
<input type=submit value='Submit'></p>
</form>
Now I want to redirect to another page notEdit.php with post data that is contained in the name of the button when I click the buttons Edit. I also want to keep the functionality of the form using the submit button. I have added the following Javascript code:
var buttons = document.getElementsByName("edit");
for(var i = 0, count = buttons.length; i<count; i++){
buttons[i].attachEvent("click", submit);
}
Now in the submit function I can add window.location to redirect to another page. But How can I attach the post data?