• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

Forcing a user to select an item from a combobox field in a form

Please could anyone point me in the right direction for forcing a user to select an item from a field.
I have a form with various fields on it.

I also have a layer on the form which is hidden until an item within a field is selected.
This opens up the layer and I now want the user to select one of the options in the drop down combobox.
At the moment it does open but I can just carry on without selecting it, therefore not capturing the data.

I have looked in the designer help and think I need to write a command that uses @Failure on the Input Enabled or Input Validation part of the field, therefore forcing the user to select an option from the field.

I really need to do this urgently if anyone can help - thanks a lot !

1 Solution
Field Input Validation:
for Field1:
@If(@ThisValue="";@Failure("Please enter value");@Success)

for Field 2:
Field Field1:=Field1;
@If(Field1!="";@if(@Thisvalue="";@Failue("Please enter value");@Success);Field2)
Richard QuadlingSenior Software DeverloperCommented:
Hi gray180,

Just a guess but is there a way of marking an item as the default item so you will always have AN item selected? If the user doesn't pick one the default will be used.


Richard Quadling.
Hi gray180,

Also, after the value is selected you need to refreshhideformulas... to get the hidden stuff to show.

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

gray180Author Commented:
Hi all,
Sorry for the delay in getting back to you.

Thanks for your help Madheeswar. I had to make a slight change to get it to work though; I don't know if it was because the layer was hidden I'm not too sure.
Here's the field 2 command I have put in.  It works, but would be grateful if anyone can see a problem with it?

FIELD Network:=Network;
@If(Domain!="customer1";@Success;@If(@ThisValue="";@Failure("Please enter value");@Success))

What happens is the user selects the network field and if it is not equal to "customer1" the "Customer_List" field doesn't require validating, hence success.

If it is "Customer1" then the field appears and a selection needs to be made.  I don't require the field data to be captured due to it is just there for information to the user.

Does this seem OK?  I understand what is going on with the command and it does work but I am no expert so I don't know if it will be OK.

Thanks for everyones input.  
Also Marilyn I had somehow unchecked the form properties for refresh all fields so thanks!
Looks OK to me ..
gray180Author Commented:
Good stuff.

Thanks again for your help.  Really is appreciated!!!!


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now