Hey, if this is not cinsidered the right place to post then please a mod can delete/lock etc...
I'm connecting to my database and reading the result from a tatable, i display the results along with a form that comprising of a dropdown option list. On selection of one of the items i want the form to be posting to the current page to be handeled. However before posting commenced i want to make sure the user means what that are doing e.g. delting row from db. Here is some of the script:
<<<HTMLBLOCK
<tr>
<td>data 1</td>
<td>data 2</td>
<td>data 3</td>
<td>data 4</td>
<td>data 5</td>
<td>data 6</td>
<td>data 7</td>
<td>data 8</td>
<td>
<form action="/subdirectory/currentpage.php" method="post">
<input type="hidden" name="id" value="id#" />
<select name="change_status" onChange="this.form.submit()">
<option value="for sale" onclick="return confirm('Are you sure you want to change to for sale?')">For Sale</option>
<option value="sold" onclick="return confirm('Are you sure you want to change to sold?')">Sold</option>
<option value="update" onclick="return confirm('Are you sure you want to update?')">Update</option>
<option value="delete" onclick="return confirm('Are you sure you want to delete?')">Delete</option>
</select>
</form>
</td>
</tr>
HTMLBLOCK;
The problem is that the onchange submits the form before the conform dialog acts, i.e by the time the conform box appears the new page is loaded and selecting yes or no hence does nothing.
How can i make it so that i select an action then confirm/or not then the script posts/or not.
Thanks
p.s. i would like to keep the action in the dialogue box so the user knows what they are agreeing to, e.g. do you want to delete.