Click here to Skip to main content
16,011,905 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
I want to check the number of days entered in a text box is not more than 15 days if it exceeds i want to display an alert message to the user how to do it using javascript
Posted
Comments
Sergey Alexandrovich Kryukov 1-Feb-12 5:49am    
What's the problem? 1) call alert? 2) get value of text box, 3) parse to integer; 4) compare integers; 5) write if statement based on condition? :-)
--SA
Sergey Alexandrovich Kryukov 1-Feb-12 5:50am    
6) Find Javascript functions using Google? MSDN?
--SA

1 solution

Dear Shashwath,

Look this sample code:

XML
<SCRIPT LANGUAGE="JavaScript">
  function testResults (form) {
  var TestVar = document.getelementbyid('txt1');
   if (TestVar>15)
   {
    alert("You entered more then 15 days")
   }

  }


Thanks
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900