Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Cannot get Submit button to work

Avatar

Level 7

I am really stumped with this one. The Submit to Manager button is not working. The only error I get is that assocID is not identified, but as far as I can tell it is identified.

Any help would be appreciated.

Thanks,

MDawn

2 Replies

Avatar

Level 7

I think the variable names may be causing a problem. I commented out the variable names, and it worked correctly, except for name. I had to change it to empName instead. Then that one worked. There's a good bit of overlap between your variable names and object names. (e.g., var assocID = assocID.rawValue) That was causing problems, too.

Here's what I ended up doing to make the alerts/email work:

//Create a variable to hold the document object

var empname = empName.rawValue;

var jobtitle = jobTitle.rawValue;

var mgrname = mgrName.rawValue;

var associd = assocID.rawValue;

var accvachrs = accVacHrs.rawValue;

//NAME

if (empName.isNull){

          xfa.host.messageBox( "Please enter your name" );

          xfa.host.setFocus("page1.empName");

}

//JOB TITLE

else {

                    if (jobTitle.isNull){

                              xfa.host.messageBox( "Please enter your job title" );

                              xfa.host.setFocus("jobTitle");

                    }

//MANAGER'S NAME

                    else {

                              if (mgrName.isNull){

                                        xfa.host.messageBox( "Please enter a your manager's name" );

                                        xfa.host.setFocus("mgrName");

                              }

//ASSOC ID

                              else {

                                        if (assocID.isNull){

                                                  xfa.host.messageBox( "Please enter your Associate ID" );

                                                  xfa.host.setFocus("assocID");

                                        }

//ACCRUED VAC HOURS

                                        else {

                                                  if (accVacHrs.isNull){

                                                            xfa.host.messageBox( "Please enter your accrued vacation hours" );

                                                            xfa.host.setFocus("accVacHrs");

                                                  }

                                                  else {

                                                            page1.Button4.execEvent("click");

                                        }

                              }

                    }

          }

}