Javascript (combo Box Dialog List) --Need help

Hi All,

I have a field on the web that is the combo box and it has 30 values as a drop down list …

How can I write,

if(document.forms[0].Fieldname.value = “P11 Basis” Then do something

I get an error…

Object expected

The value selected "P11 Basis is the 25th element if I count 0 as my first element

Please help

Thanks in advance,

ac ac

Subject: Javascript (combo Box Dialog List) --Need help

Try this:

if(document.forms[0].Fieldname.options[document.forms[0].Fieldname.selectedIndex].value == “P11 Basis”) Then do something…

HTH

Subject: RE: Javascript (combo Box Dialog List) --Need help

You could also take a look at the atGetField() function I posted some time back – since field types can change in Domino depending on hide-whens, form formulas, and so on, it can be easier to have a consistent interface to field values that doesn’t depend on knowing the type ahead of time. With atGetField() you just need to throw either a field object or a field name at the function and you ALWAYS get back an array.