Link to home
Start Free TrialLog in
Avatar of cscb08
cscb08

asked on

How do I write code to check for empty drop-down list box

Hi there,
I need to verify that a value has been entered into a drop down box on my infopath form. I am brand new to infopath and c# so please excuse my ignorance.

What i have is a button that submits drop down/text box values to a sharepoint list. I have tried to use the standard 'Data Validation' on the drop down fields themselves, but the c# code executes first before the built in 'Data Validation' goes to check the value.

Basically I need an example of c# syntax in infopath that will check for a null value in the drop down boxes.
Here is some pseudocode of what im after

if (dropdown1 is empty) then
stop executing code and set focus to dropdown1
else
process rest of code

if anyone could provide an example that would be great.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Clay Fox
Clay Fox
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cscb08
cscb08

ASKER

Hi clayfox. Cheerss for that. I have found the solution, I was able to find some example c# code that now works.