473,396 Members | 1,895 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,396 software developers and data experts.

age validations in javascript

10
hi all

can any one help me in age validations from 1 to 100 through javascript.


very urgent for me ......plz help me yaar.
Sep 25 '07 #1
3 1133
gits
5,390 Expert Mod 4TB
hi ...

please post the code you already have ... and explain in detail what you want to do ...

kind regards
Sep 25 '07 #2
banjuu
10
here is my java script code:

Expand|Select|Wrap|Line Numbers
  1. if((document.start.age.value.length==0)||(isNaN(document.start.age.value))||(document.start.age.value.length>120))
  2.         {
  3.             alert("Please enter the age between 1 to 100")
  4.             document.start.age.value="";
  5.             document.start.age.focus();
  6.             return false;
  7.         }
here is my html code of tht:[HTML]<td class="headinggry" height="20">Age*</td>
<td class="alternate1"><div align="left"><span >
<inputname="age"type="text"class="body"width="150" >[/HTML]
Sep 25 '07 #3
dmjpro
2,476 2GB
here is my java script code:
Expand|Select|Wrap|Line Numbers
  1. if((document.start.age.value.length==0)||(isNaN(document.start.age.value))||(document.start.age.value.length>120))
  2.         {
  3.             alert("Please enter the age between 1 to 100")
  4.             document.start.age.value="";
  5.             document.start.age.focus();
  6.             return false;
  7.         }
here is my html code of tht:
Expand|Select|Wrap|Line Numbers
  1. <td class="headinggry" height="20">Age*</td>
  2.                                        <td class="alternate1"><div align="left"><span >
  3.                                   <inputname="age"type="text"class="body"width="150">
Use code Tags while you do Post.
Read the posting guidelines.
Try this :-)

Expand|Select|Wrap|Line Numbers
  1. if((document.start.age.value.length==0)||(isNaN(document.start.age.value))||(document.start.age.value>120)||(document.start.age.value<1))
  2. {
  3. //some code goes here
  4. }
  5.  
I think it will work.
Good Luck :-)

Kind regards,
Dmjpro.
Sep 25 '07 #4

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

Similar topics

2
by: anil kumar via .NET 247 | last post by:
(Type your message here) hi, i am using save & cancel webform button my webpage to with somevalidations , when i am trying to save my content it is savedthat time i need a popup msg like ur 'data...
1
by: Anup | last post by:
In my form I and doing validations using 'Javascript' as I m using ASP1.1 and there is very less support for Validators there. //Code Behind private void Page_Load(object sender,...
3
by: Sunil | last post by:
Hi, I have a from with around 8 date fields. All these are entered by the user and are to validated for holidays. The holiday validation can only be done on server side. I am planning to use...
1
by: harishkumar | last post by:
hi this is hari how to write the email id checking in javascript validations using in vb.net 1) if u r cecking in email id this types of message to delever to user a)(.) dot is missing b) two @...
2
by: vinylason | last post by:
in my website javascript validations are not working in firefox, can any any one of u say why ? and if u know the solution tell me
2
by: prakashsurya | last post by:
Hello I am going through the validations in a form I would like to know the validations to be considered in writing javascript for email id so would u plz help me in writing the necessary...
10
by: polydegmon | last post by:
I'm having a problem with client side validations. When i use the code below it breaks at line 14 "var vSearch = document.getElementById("txtSearch").value;" When i use a simple form with a form...
5
by: psrivani4 | last post by:
I want how to validate more than one email id in javascript in composemail for TO,CC fields.Please send it to my mail id Iam waiting for ur reply. Byeeeee.
2
by: swethak | last post by:
hi , i write the code in .htm file. It is in cgi-bin/searches/one.htm.In that i write a form submitting and validations.But validations are not worked in that .htm file. I used the same code in my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.