4
4Ankit
Hey guys i am having some trouble with nesting one selection structure
within another selection structure. At the moment i am unclear what
selection structures are and just need a simple example of a selection
structure within another selection structure. I am supposed to use
function definitions with parameters to validate a form. my code for
what i have done so far is as follows(cropped):
function mainFunction() {
var dateFormat = (document.dateFormat.date.value + " " +
document.dateFormat.month.value + ", " +
document.dateFormat.year.value);
window.alert("The date is " + dateFormat);}
return; }
function checkDate( ) {
if (0<parseInt(document.dateFormat.date.value) &&
parseInt(document.dateFormat.date.value)<=31) {
return true;}
else {window.alert("Problem with the date");
return false;} }
Basically how can i change the above checkDate function in include a
selection structure nested within another selection
structure.Eventually i will have another 2 functions which will b used
to validate the year and month the user enters. Your help would be
great
Have a nice day
within another selection structure. At the moment i am unclear what
selection structures are and just need a simple example of a selection
structure within another selection structure. I am supposed to use
function definitions with parameters to validate a form. my code for
what i have done so far is as follows(cropped):
function mainFunction() {
var dateFormat = (document.dateFormat.date.value + " " +
document.dateFormat.month.value + ", " +
document.dateFormat.year.value);
window.alert("The date is " + dateFormat);}
return; }
function checkDate( ) {
if (0<parseInt(document.dateFormat.date.value) &&
parseInt(document.dateFormat.date.value)<=31) {
return true;}
else {window.alert("Problem with the date");
return false;} }
Basically how can i change the above checkDate function in include a
selection structure nested within another selection
structure.Eventually i will have another 2 functions which will b used
to validate the year and month the user enters. Your help would be
great
Have a nice day