"onsubmit()" problems

S

Simon Wigzell

My client has many forms on his Business website. They all use the
"onsubmit" verification method e.g.

<form ......... onsubmit="return FormValidator(this);">

<script>
function FormValidator(TheForm)
{
if (TheForm.[Field].value == "")
{
alert("You must complete field blah blah blah");
return false;
}

return true;
}
</script>

(I just typed this out so please don't bother correcting any typos or syntax
errors)

Works fine for me, works fine for most people but occassionally the
resulting form results that are emailed to him by the webpage have empty
fields. It is not possible to submit the form with the fields empty. (No,
they don't contain spaces either. Same thing happens for selection lists
where the first field is blank)

Anyone ever seen this before? I've emailed the clients to ask them what
their operating system/browser etc. are but they can't be bothered to reply.
I know they have javascript working because the forms are all in popup
windows created by javascript.

Any ideas at all? Thanks!
 
J

Jerry Park

Simon said:
My client has many forms on his Business website. They all use the
"onsubmit" verification method e.g.

<form ......... onsubmit="return FormValidator(this);">

<script>
function FormValidator(TheForm)
{
if (TheForm.[Field].value == "")
{
alert("You must complete field blah blah blah");
return false;
}

return true;
}
</script>

(I just typed this out so please don't bother correcting any typos or syntax
errors)

Works fine for me, works fine for most people but occassionally the
resulting form results that are emailed to him by the webpage have empty
fields. It is not possible to submit the form with the fields empty. (No,
they don't contain spaces either. Same thing happens for selection lists
where the first field is blank)

Anyone ever seen this before? I've emailed the clients to ask them what
their operating system/browser etc. are but they can't be bothered to reply.
I know they have javascript working because the forms are all in popup
windows created by javascript.

Any ideas at all? Thanks!
According to how the code is written, you may just get another browser
window when javascript is turned off.

Have you tried turning off javascript and seeing what you get?
 
S

Simon Wigzell

snip
According to how the code is written, you may just get another browser
window when javascript is turned off.

Have you tried turning off javascript and seeing what you get?

As I said, the page with the form in it is popped up with javascript so if
javascript was turned off they wouldn't even get the form! And it is only a
few people, 3 out of hundreds in the last few months.
 
J

Jerry Park

Simon said:
snip




As I said, the page with the form in it is popped up with javascript so if
javascript was turned off they wouldn't even get the form! And it is only a
few people, 3 out of hundreds in the last few months.
But are you sure that is what happens? Best to check. Difficult to fix a
problem until you know the nature of the problem.
 

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

Similar Threads


Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,216
Latest member
topweb3twitterchannels

Latest Threads

Top