submit form using a function and a confirm box

B

btopenworld

I am submitting a form using an image as the link to a js file.
The image calls a js function which checks fields- issuing alerts for
errors - if no errors it then submits the form.
I would like to have a final confirm box run from the function before the
form is submitted.
I guess I would have to use the return statement somehow but I can't see
quite how.
Any help gratefully accepted

John
--
____________________________________________________________________
The information in this message is confidential and is intended solely
for the addressee. If you are not the recipient intended by SiteWeave,
any disclosure, copying, distribution or any action taken or omitted to
be taken in reliance on it, is prohibited.

Please note that all business is subject to our terms and conditions,
available upon request or through our website.

www.siteweave.net
____________________________________________________________________
 
B

btopenworld

Janwillem Borleffs said:
A simple

<form onsubmit="if (formValidated()) return confirm('Submit form?'); else
return false"....>

should to do it.

JW
thanks - could you tell me what the end of the validation script does - at
the moment it is submitting the form - document.form1.submit() - this seems
to bypass the onsubmit part of the form. I can't use a normal submit button
because I am using an image to trigger the submission

thanks
John
 
R

Richard Cornford

... . I can't use a normal submit button
because I am using an image to trigger the submission

<input type="image" src="example.gif">

Richard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top