473,785 Members | 2,396 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.dateF ormat.date.valu e + " " +
document.dateFo rmat.month.valu e + ", " +
document.dateFo rmat.year.value );
window.alert("T he date is " + dateFormat);}
return; }

function checkDate( ) {
if (0<parseInt(doc ument.dateForma t.date.value) &&
parseInt(docume nt.dateFormat.d ate.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.Event ually 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 2326
ASM
4A****@gmail.co m a écrit :
Basically how can i change the above checkDate function in include a
selection structure nested within another selection
structure.Event ually 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("P roblem 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("P roblem with the month");
v.focus();
return false;
}
}
function checkYear( whatForm ) {
var v = ... etc ...
}

function mainFunction( whatForm ) {
checkDat(whatFo rm);
checkMonth(what Form);
checkYear(whatF orm);
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
1817
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
14480
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 me do this saying that I can't declare a structure with fixed size arrays. Yet the book I'm looking at shows
7
4508
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
6307
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 no_of_a;
2
6505
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
1657
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
6681
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 *retStatus) // Structure tss_user_profile_t from the function typedef struct {
0
4668
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 and also get the datakey (in my case personid) of the the rows selected. Please point me in the right direction. This is what i have so far but i have problem accessing the child gridview in the button click event Cheers, Shilpa. <asp:GridView...
15
3773
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> #include <stddef.h>
0
9481
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10341
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9954
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7502
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.