Expand my Community achievements bar.

Help With Simple if Script??

Avatar

Level 2

Hi

I have a text field named literature. In the text box i have Not Required as the default.

At the bottom the form i want to create something that tells shipping Literature Required Yes or No.

Basically if they leave the field literautre no touched so it says Not Required the bottom would say No but if they change it to anything else it would say Yes.

I tried putting in a text field at the bottom of the page called litreq and tried to add in a script but i cant get anything to work.

Here is one i tried.

form1.#subform[0].#subform[1].litreq::initialize - (JavaScript, client)

if

literature="Not Required"

litreq

="No"

else

litreq

="Yes"

3 Replies

Avatar

Former Community Member

Move the script to the exit event on literature and change the script to....

if (literature.rawValue == "Not Required") {

    litreq.rawValue = "No";

}

else {

    litreq.rawValue = "Yes";

}

Steve

Avatar

Level 2

Thanks alot I appreciate it I will try it tomorrow and let you know!

Bill