Submit the form data to the php script only if the user clicks on OK.
function checkSubmission(form)
{
var ans = confirm("Are you sure you want to delete the row?");
if(ans)
{
//perform validation
form.submit();
}
}
Call this function on the onclick event of the submit button and pass to it, the form object. Something like: <input type="button" value="Submit" onclick="checkSubmission(this.form);" />
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
You need to be more precise when you say its not working. You either need to paste a working example here or try to put a lot of alert statements here and there in your code to see which part is creating problems for you.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
I seem to remember that you can have only one set of script tags in the body. Put both functions in the same script tag pair.
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
You must have made changes to your original code. Post the most recent, working code as it is.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734