Total members 11895 |It is currently Thu Dec 26, 2024 11:26 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Following code check enter as <select> options as day,month and year.

Code:
function checkAgeCheckBox(f){
var 
dob=new Date();
var 
date=dob.getDate();
var 
month=dob.getMonth() + 1;
var 
year=dob.getFullYear();
var 
cmbmonth=parseInt(document.getElementById("cmbmonth").options[document.getElementById("cmbmonth").selectedIndex].value);
var 
cmbday=parseInt(document.getElementById("cmbday").options[document.getElementById("cmbday").selectedIndex].value);
var 
cmbyear=parseInt(document.getElementById("cmbyear").options[document.getElementById("cmbyear").selectedIndex].value);
age=year-cmbyear;
if(
cmbmonth>month){age--;}
else{if(
cmbmonth==month && cmbday>=date){age--;}}
if(
cmbmonth==0){return false;}
else if(
cmbday==0){return false;}
else if(
cmbyear>=2005){return false;}
else if(
age<'.$age.'){
return 
true;
}
 




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time

You can use an HTTP request to call an exnisitg API which provides the IP. For example there is the XML API at , but there should be much more simpler APIs to access.



Author:

what are u talking about ?


_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 3 posts ] 

  Related Posts  to : validate age entered as selection box in javascript
 validate mail in jsp     -  
 validate username     -  
 validate e-mail in php     -  
 validate domain name in php     -  
 validate email address in asp     -  
 validate international phone number value     -  
 selection sort     -  
 C++ Selection Sort     -  
 Help with selection sort for strings?     -  
 fill selection options from list     -  



Topic Tags

JavaScript Validation
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com