Connecting Tech Pros Worldwide Help | Site Map

"onsubmit()" problems

  #1  
Old July 20th, 2005, 03:30 PM
Simon Wigzell
Guest
 
Posts: n/a
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!


  #2  
Old July 20th, 2005, 03:30 PM
Jerry Park
Guest
 
Posts: n/a

re: "onsubmit()" problems


Simon Wigzell wrote:[color=blue]
> 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!
>
>[/color]
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?
  #3  
Old July 20th, 2005, 03:30 PM
Simon Wigzell
Guest
 
Posts: n/a

re: "onsubmit()" problems


snip
[color=blue]
> 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?[/color]

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.


  #4  
Old July 20th, 2005, 03:30 PM
Jerry Park
Guest
 
Posts: n/a

re: "onsubmit()" problems


Simon Wigzell wrote:
[color=blue]
> snip
>
>[color=green]
>>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?[/color]
>
>
> 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.
>
>[/color]
But are you sure that is what happens? Best to check. Difficult to fix a
problem until you know the nature of the problem.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
MAC Browsers and Compatibility with Windows Browsers HEX answers 57 November 9th, 2007 04:23 PM
problems with dynamic forms brian.newman@wpafb.af.mil answers 11 July 23rd, 2005 05:49 PM
Problems with form elements that are hidden with <div style="display:none"> Dan R Brown answers 13 July 20th, 2005 10:30 AM
Problem in document.formName.OnSubmit("return validationCheck(a,b,c)") event used in a function in an ASP Page Varun answers 3 July 19th, 2005 12:16 PM