Total members 11893 |It is currently Tue Nov 05, 2024 5:43 pm 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 username     -  
 validate e-mail in php     -  
 validate domain name in php     -  
 validate mail in jsp     -  
 validate email address in asp     -  
 validate international phone number value     -  
 selection sort     -  
 C++ Selection Sort     -  
 Help with selection sort for strings?     -  
 Good looking selection box with image per option     -  



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