Folks can you have a look at the code below and tell me if I have missed something.
The Background is that in the movie clip(page5) I have 2 yes/no questions controlled by radio groups the first is in the root of the movie clip. If the user clicks no to the first question(radio_a) this reveals a movie symbol "ifno" which contains a dynamic multiline textarea "inputno"(not a component) which has "Comments" as the variable and the second question (radio_b). If the user then answers yes to the second question this reveals a second movie symbol "ifyes" which simply contains a dynamic multiline textarea "inputyes" which has Comments1 associated with it.
The problem that I am having is that I want to validate the form such that if radio_a = no then the user must enter something into the textarea "ifno" and must answer radio_b then if radio_b =yes the user must enter something into textarea "ifyes"
the code I am using is:
returnVal = true; //default value
// check if radio_a is answered
if (this.page5.radio_a.getValue() == undefined) {
returnVal = false;
} else if (this.page5.radio_a.getValue() == No) {
if (this.page5.ifno.radio_b.getValue == undefined) {
returnVal = false;
} else if (this.page5.ifno.radio_b.getValue == 'Yes')
{
if (this.page5.ifyes.inputyes=null) {
returnVal = false;
}
} else if (this.page5.ifno.inputno=null) {
returnVal = false;
}
}
the problem that I am having is that it will not validate the form at all. Any suggestions will be gratefully received![[morning] [morning] [morning]](/data/assets/smilies/morning.gif)
THe Start of wisdom is to realise you know nothing. I'll be a genius then!
The Background is that in the movie clip(page5) I have 2 yes/no questions controlled by radio groups the first is in the root of the movie clip. If the user clicks no to the first question(radio_a) this reveals a movie symbol "ifno" which contains a dynamic multiline textarea "inputno"(not a component) which has "Comments" as the variable and the second question (radio_b). If the user then answers yes to the second question this reveals a second movie symbol "ifyes" which simply contains a dynamic multiline textarea "inputyes" which has Comments1 associated with it.
The problem that I am having is that I want to validate the form such that if radio_a = no then the user must enter something into the textarea "ifno" and must answer radio_b then if radio_b =yes the user must enter something into textarea "ifyes"
the code I am using is:
returnVal = true; //default value
// check if radio_a is answered
if (this.page5.radio_a.getValue() == undefined) {
returnVal = false;
} else if (this.page5.radio_a.getValue() == No) {
if (this.page5.ifno.radio_b.getValue == undefined) {
returnVal = false;
} else if (this.page5.ifno.radio_b.getValue == 'Yes')
{
if (this.page5.ifyes.inputyes=null) {
returnVal = false;
}
} else if (this.page5.ifno.inputno=null) {
returnVal = false;
}
}
the problem that I am having is that it will not validate the form at all. Any suggestions will be gratefully received
![[morning] [morning] [morning]](/data/assets/smilies/morning.gif)
THe Start of wisdom is to realise you know nothing. I'll be a genius then!