If statement question in Adobe Designer

10-11  Source: Network gathering  Views:0 

Advertisement
This code here:
else if(application.page1.citizen.rawValue==0){
app.alert("Please select whether you are a United States citizen");
xfa.host.setFocus("application.page1.citizen");
else if(application.page1.citizen.rawValue==2){
app.alert("Please select whether you are legally permitted to be employed in the United States");
xfa.host.setFocus("application.page1.legally");
The first if statement checks to see if the group of radio button(s) "citizen" has been selected (yes or no). Works fine. If the citizen radio button with a value of 2 (no) has been selected, kick out another error message indicating additional radio buttons (legally) is needing selection. This is my problem, when I select yes or no on the "legally" group of radio buttons, the second alert keeps popping up. Why can't it kick out and go on through the page? Am I missing something logically in the JS?
Any help or suggestions would be appreciated.
Well, I've been thinking that and I can't nail what I could be missing logically. I've got:
else if(application.page1.citizen.rawValue==0){
app.alert("Please select whether you are a United States citizen");
xfa.host.setFocus("application.page1.citizen");
else if(application.page1.citizen.rawValue==2){
else if(application.page1.legally.rawValue==1 || application.page1.legally.rawValue==2){
app.alert("Please select whether you are legally permitted to be employed in the United States");
xfa.host.setFocus("application.page1.legally");
The second if statement checks to see if they selected "no" for citizen. I've added in another if statement checking to see if legally radio buttons have already been filled in. Using the above approach kills my script from executing period.
Related articles