View Full Version : form validation

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


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

alert("please enter the field");



<form name="testForm" >

<input type="text" name"userInput" size="30" >

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



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

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

Good luck.

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

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum