cancel
Showing results for 
Search instead for 
Did you mean: 

Check combo box for valid value

Former Member
0 Kudos

Hey Everyone,

I was wondering if someone could tell me the correct method for checking a combo box list of valid values to ensure it contains a certian value before trying to select it. The problem I have is sometimes my code ends up trying to select a value that does not exist in the combo box and it throws an exception.

Any help would be appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

You could try something like this:


vvs = itm.Specific.ValidValues
blnFound = False
For Each vv in vvs
  If vvs.value = strMyValue Then
     blnFound = true
     Exit For
  Endif
Next For 

If blnFound Then
   itm.Specific.Select(strMyValue)
Else
   MsgBox ("Hey man! That was not an option.")
Endif
 

HTH

Juha

Answers (2)

Answers (2)

former_member679019
Participant
0 Kudos
onLiveValidate:function(oEvent){
	var oInput= oEvent.getSource();
	var bValid= !oInput.getSelectedKey();
	oInput.setValueState(bValid ? "Error":"None");
m_felicella
Participant
0 Kudos

Many thank's