Select Field Current Value

Hey folks,

So, I have a form. On this form I have a widget that has a text field. I also have a widget that has a select field.
The select field is called ‘select4’

Select4 has the options 'Please Select,'Other,‘New’. I can run these and in the drop down I get these options to select.

With the text field/widget, I have the following code to display when the Select4 widget has ‘Other’ selected:

if (field_TextField4 == ‘Other’){
return true;
}else{
return false;
}

Once select4 has ‘Other’ selected, the text widget should show. This though is not working.

Is the if statement incorrect? I have a feeling that I need to get the current selected value not just ‘ield_TextField4’

So something more like:

if (field_TextField4.theCurrentSelectedValue == ‘Other’){
return true;
}else{
return false;
}

Any ideas?

Many thanks,
Jim

Would the code be more like this?

if (field_TextField4.value() == ‘Other’){
return true;
}else{
return false;
}

Tried it, get an error: “Error while updating the value of field TextField5”

But at least the page did something…

The solution was:

if (field_Select4.equals(“Other”))
{
return true;
}else{
return false;
}