View Single Post
  #1 (permalink)  
Old July 28th, 2003, 02:36 AM
mateenmohd mateenmohd is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default onClick event problem

There is error in onClick event.
How can check multiple record a to z value if datatype is numeric, if user inter character value
It should gives message that “ enter Numeric value “

<head>
<script language=JavaScript>
function docheck()
{
for (i=0;i<=10;++i)
 {
 x=document.forms[0].elements[i].value
 n=document.forms[0].elements[i].name

   if (i==0)
  {
  fn=document.forms[0].elements[i].value
    if (fn=="a,b,c,d,e,f.,,,,,,,,,,,………..") // a to z
   {
   alert ("Please enter Numeric Value ")
   document.forms[0].elements[i].focus()
   return false;
   }
  }
}
}
document.myform.submit()
}
</script>
</head>

<input type=submit value="show drawings" onClick=”docheck()”>

Mateen
Reply With Quote