Re: Form validation issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"then the page gets reloaded and clears all the javascript error messages
and does the PHP validation."
That is because the form is getting submitted... make sure you js code
prevents form submit if errors are found....



Midhun Girish


On Mon, Dec 21, 2009 at 8:13 AM, Ernie Kemp <ernie.kemp@xxxxxxxxxxxx> wrote:

>   Good Day,
>
>
>
>                 I need help in in validating a form.
>
>                 The for is valdated be a javascript frist then if all the
> fields are filled in its valaded be PHP.
>
>
>
>                 The Form starts with:
>
>                 <form name="myForm" action="<?php echo
> $_SERVER['PHP_SELF'];?>" method="post" onsubmit='return formValidator()' >
>
>
>
> The “formValidator()” goes to a javascript and does display the missing
> information in this case BUT then the page gets reloaded and clears all the
> javascript error messages and does the PHP validation.
>
>
>
> The PHP only runs if the fields are set by testing using ‘isset”.
>
>
>
> Without puting on numeric lines of go can you suggest things I must have
> overlooked. Silly request but there must be something I’m overlooking.    I
> have simular code on other programs but this one is casuing me trouble.
>
>
>
> Thanks every so much..
>
>
>
> ....../Ernie
>
>
>
>
>
>
>
>
>
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux