473,403 Members | 2,323 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,403 software developers and data experts.

selection structure nested within another selection structure

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

Dec 7 '06 #1
1 2303
ASM
4A****@gmail.com a écrit :
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.
function checkDate( whatForm ) {
var v = document.forms[whatForm].date.value
if (0<=v && parseInt(v)<=31) return true;
else {
window.alert("Problem with the date");
v.focus();
return false;
}
}

function checkMonth( whatForm ) {
var v = document.forms[whatForm].month.value
if (0<=v && parseInt(v)<=12) return true;
else {
window.alert("Problem with the month");
v.focus();
return false;
}
}
function checkYear( whatForm ) {
var v = ... etc ...
}

function mainFunction( whatForm ) {
checkDat(whatForm);
checkMonth(whatForm);
checkYear(whatForm);
var dateFormat = (d ... etc ...
}
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Dec 7 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: imme929 | last post by:
I got things working until I tried adding this enum to a structure... Public Enum Keyboard EnglishUS EnglishUK Spanish German Italian French
8
by: John Dann | last post by:
Trying to declare a structure that will contain a couple of fixed-size arrays. I'm trying eg: Structure IndexRecord Dim testarray(16) as Byte etc End Structure But vb.net is refusing to let...
7
by: Daniel Rudy | last post by:
Is the following code legal? typedef stuct data_type_tag { int var1; int var2; int var3; struct { void *p; size_t size; unsigned int flags;
2
by: ksarkar | last post by:
I have a problem regarding array of structures within a structure. I have an static array of structure within a structure eg. typedef struct { int x; }A; typedef struct { int...
2
by: Fred Flintstone | last post by:
Why not? Why can't I put a table within paragraph tags? Also: "Element DIV cannot be nested within element 'u'." I can't underline something within div tags? Why not? Thanks! :)
9
by: nano2 | last post by:
Hi , Have the following case passing in structure pointers and returning structure pointers can anyone spot whats wrong with this structure name is structCar void callfn( ){
3
by: Amit_Basnak | last post by:
Dear Friends I have the follwoing function "tss_fe_get_own_info" which has the arguments as shows below tss_fe_get_own_info(char *user_id, tss_user_profile_t **p_buf_UserSecInfo, error_status_t...
0
by: sharonrao123 | last post by:
hello all, I have a parent gridview company and in this one a nested gridview people, Is it possible to allow the user to select one row or multiple rows from the people gridview using a check box...
15
by: bernd | last post by:
Hi folks, a simple question for the experts, I guess. Obviously I am doing something wrong when trying to access an element of an array declared within a structure: #include <stdio.h>...
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: 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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.