Expand my Community achievements bar.

Drop Down contition

Avatar

Level 7

I have a  MANTATORY Drop Down with the following items:

Select One

Change

Leave

Termination

I have the item"Select one" to indicate users, they must to select a item for the DD.

The problem I have is: if they forget to select a item still the can email the form!

DD is mantatory but because there is a item(Select One) they can email the form.

There is any way to avoid the above so, if they miss to select a item from the DD

with a warning message to remind them for the missing field?

Thanks for your help

1 Reply

Avatar

Former Community Member

A common solution (there are other more sophisticated solutions using the event model) is to add a button which validates form fields and then 'clicks' the submit button. The button that does the submit, whether it is email, web service call, or printing for example, has it's visibility set to 'hidden'.

For example, I added a button called 'callEmailBtn'. When clicked it tests the value of the drop-down. If the drop-down does not contain 'Select One' the execEvent method is used to click the email submit button.

// form1.#subform[0].callEmailBtn::click - (JavaScript, client)

if (Employee_Status.rawValue == "Select One") {

     xfa.host.messageBox("Please select an option from employee status.");

}

else {

     EmailSubmitButton1.execEvent("click");

}

FYI. I had to comment out the change event processing on 'Employee_Status'. It looks like you some undone work there.
Steve