i think you're not calling the the javascript validation function when
you're submiting the form

you need to call the function like this:
<form method="post" action="registration1.php"  onsubmit="return
Field_Validator(this)">

try this code below, hope this will help

-awlad
--------------------------------
<html>
<body>

<script Language="JavaScript">
<!--
function Field_Validator(form)
{


if (form.name.value == "")
{
alert("Please fill in the name field.");
form.name.focus();
return (false);
}


return (true);
}

//-->
</script>
<form method="post" action="where_ever_you_want.htm"  onsubmit="return
Blank_TextField_Validator(this)">

<p>
name
<br>
<input type="text" name="name" >
<br>



<input type="submit" value="Submit">
</form>
</body>



----- Original Message -----
From: "Diksha Neel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 12:33 PM
Subject: [PHP] JAVASCRIPT


> dear all,
>
> hi!
>
> in my php script registration1.php, i have written
> javascript for form validation i.e. for checking if
> the mandatory fields are filled correctly or not.
> but on clicking the submit button, i get connected to
> the next page without the form getting validated!!
>
> i guess i have made a silly mistake somewhere but am
> not able to figure out where and what.
> attaching registration1.php.
>
> please help.
> thanks.
> regards,
> diksha.
>
>
>
>
>
>
>


----------------------------------------------------------------------------
----


> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to