...

View Full Version : form validation



whatsup
10-11-2003, 07:41 AM
i have problem validating can anyone help please

<html>
<head>

<script type="text/javascript">
function isEmpty() {
userData = document.testForm.userInput.value;
if(userData == null || userData == '') {

alert("please enter the field");

}
}
</script>
</head>

<body>

<form name="testForm" >

<p>Name:
<input type="text" name"userInput" size="30" >

</p>
<p>
<input type="button" name="validateButton" value="Validate" onClick="isEmpty()">

<p>
</form>

</body>
</html>

wickford
10-11-2003, 01:31 PM
There is a typo on your HTML.

name"userInput" should be name="userInput".

Good luck.

whatsup
10-11-2003, 02:37 PM
thanks for that wickford:cool:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum