Hi
Im trying to have my switch selections do a couple of things from one selection and am getting stuck on the correct syntax to use
below is a code example of what i'm trying to do - but basically i need a selection case "2" say, to (1) set various fields values from variables (2) set the focus event to a field (that relates to the choice)
here's an example of my (broken) code (orange below) - does anyone know the correct syntax for doing this? The field i want to force the focus/view to go to in a couple pages down (if that makes a difference)....
thanks
switch (this.rawValue) {
case "8":
{cHist.presence = "visible";}
break;
case "1":{
(page3.para1.rawValue = a1.value)
(page3.para2.rawValue = b1.value)
(page3.target.presence = "visible")
(xfa.host.setFocus(page3.target)
}
// the idea being to make the field visible then take the users focus to it once the variables have been set - i hope switch can do multiples and it's just my syntax (again) -- thanks for the help
break;
case "2": {
(page3.para1.rawValue = a1.value)
(page3.para2.rawValue = b2a.value + ", which occured in " + page5.oneEBA.rawValue + ")." + b2b.value)
}
Solved! Go to Solution.
Views
Replies
Total Likes
xfa.host.setFocus(page5.oneEBA);
Views
Replies
Total Likes
The case does not use braces "{}". See https://developer.mozilla.org/En/Core_JavaScript_1.5_Guide:Conditional_Statements
Try
switch (this.rawValue) {
case "a":
expression;
expression;
...
break;
case "b":
expression;
....
break;
default:
break;
}
Steve
Views
Replies
Total Likes
thanks steve,
it seems to accept this syntax:
case "5":
page3.para1.rawValue = d1.value + " " + page2.datedisqual.rawValue + "in the " + page2.courtdisqual.rawValue + " District Court";
page3.para2.rawValue = d3.value;
xfa.host.setFocus.page5.oneEBA;
}
Views
Replies
Total Likes
xfa.host.setFocus(page5.oneEBA);
Views
Replies
Total Likes
perfect thanks
Views
Replies
Total Likes
Hi steve,
thanks for the hep earlier, i just have one other (hopefully simple question, if you can spare a few minutes) - namely can you/how do you attach a switch statement to a field (exit event) that uses the rawvalue of another dropdown list to determine what to do (another syntax issue i guess)...
here's my issue/code:
switch (worktype.rawValue)
case "1": {
page3.para5.rawValue = f1 + this.rawValue +".";
}
break;
case "2": {
page3.para5.rawValue = f1 + this.rawValue +"222222.";
}
break;
case "3": {
page3.para5.rawValue = f1 + this.rawValue +"3333";
}}
Views
Replies
Total Likes
Views
Likes
Replies