473,322 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Need numeric validation for a field in a form

i need to validate the form .. fields should not be empty is justified... but the last field i.e var z should be numeric ..please reply fast

Expand|Select|Wrap|Line Numbers
  1. function validateform()
  2. {
  3. var x=document.getElementById("nameid").value;
  4. if(x==''){alert("name should not be empty");return false;}
  5. var y=document.getElementById("qualificationid").value ;
  6. if(y==''){alert("qualification should not be empty");return false;}
  7. var z=document.getElementById("rollnumid").value;
  8. if(z==''){alert("rollnum should not be empty");return false;}
  9. }
Aug 16 '12 #1
2 1212
gits
5,390 Expert Mod 4TB
you might use the isNaN method for that check
Aug 16 '12 #2
ariful alam
185 100+
@satyasampan, you should have a look @ the following link

http://bytes.com/topic/php/answers/9...ry#post3725937

Hope works for you. :)
Aug 16 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: CSDunn | last post by:
Hello, I need to apply validation to two text boxes. One text box named FirstNumber is required to contain only numbers, and be only three digits long. The other text box named SecondNumber...
0
by: amessimon | last post by:
Hi I have a long form - around 80 fields - which i have decided to break up into more manageable sections using the <asp:Panel> control. Basically i have three panels (stages) containing...
4
by: bienwell | last post by:
Hi, I have a problem and really need your help. In my web page ASPX, I have some text fields to accept data from users. I did form validation like this : <td class="dataTD" style="HEIGHT:...
3
sheenattt
by: sheenattt | last post by:
I want some help for checking numeric field and string field of a textbox thru Javascript.Ive tried these coding but its not working properly.If you have some other coding plz do fwd it. <html>...
3
by: wassimdaccache | last post by:
I have tow questions GUYS 1)I need to write a string of characters in a text_box and after update I need to open a form contains product list that begin with the string wrote... I used LIKE...
0
by: josh | last post by:
HI I'm new to .asp and vbscript and I need to validate a form before it is emailed to me. I don't really understand what email functionality I have on the server (and the tech support might get...
1
by: Sudarhan | last post by:
Hello frnds I have created a webbased form using asp and javascript .. while submitting the form i am validating the fields in the form .it validates the field and returns alert message. but when...
1
by: ambi21hs | last post by:
Hi i need a validation code in c for month in the mon-yyyy format 2 embed in between sql so any one help me out with this.. thank you
3
by: sylver | last post by:
To convert "12q" to "12": var text = "12q"; var twelve = parseInt(text); //twelve == 12 or you can user parseFloat()..depends on your needs :D
25
by: Rajesh Kesari | last post by:
Please Help; need to populate a form with a predecided set of fileds which may be used seperately as well. To be more specific; I have a form (frmTestValues - a continuous form) based on table...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.