javascript is definately one of my weak points. i have a select box with the options of 'edit' and 'delete'.
i need to run a confirm javascript only if 'delete' is selected.
here's the javascript
:
Code:
<SCRIPT type="text/javascript">
<!--
function verifyDelete(id)
{
if(confirm("Are you sure you want to delete this item?"))
return true;
else
return false;
}
-->
</SCRIPT>
and here's my form:
Code:
<form method=post action=http://codenewbie.com>
<select name=modify>
<option value=edit32>edit</option>
<option value=delete32>delete</option>
</select>
<input type=submit name=submit value=submit onClick="return verifyDelete()">
</form>