Scripting Assistance Needed

Avatar

Avatar

SRenae

Avatar

SRenae

SRenae

17-09-2009

I'm working on a form.  What I need it to do is this:

The end user will check a box to add comments.  The comments field is NOT visable until the check box is checked.  Once the checkbox is checked then a text box will appear directly underneath it.

Thank you in advance!

SRenae

Accepted Solutions (0)

Answers (8)

Answers (8)

Avatar

Avatar

xrum

Avatar

xrum

xrum

17-09-2009

myTextbox is an "example" name of the text field you are trying to hide/display.

where on the form is it?

if you have not yet added it to the page, the add it under your check box (or whereever)

you can name it whatever you want.

then the code would be

thenameofyourtextfield.presence.......

Avatar

Avatar

xrum

Avatar

xrum

xrum

17-09-2009

if (myCheckbox.rawValue == 1)

     myTextbox.presence="visible"

else

     myTextbox.presence="hidden"

Avatar

Avatar

SRenae

Avatar

SRenae

SRenae

17-09-2009

I got it!  The language was running at the server not the client.

Your code worked perfectly!!  Thank you so much!  I just might be posting more out here now!  🙂

S

Avatar

Avatar

xrum

Avatar

xrum

xrum

17-09-2009

i do not see a comments field anywhere in your hierarchy.

to get the right text box you can your a "ctrl" shortcut

when you are in the code window for your checkbox (make sure the cursor is active in the code area i.e. the little line is blinking)

then hold ctrl and click on the text field you want to use

(when you hold ctrl the cursor will turn into a little triangle thing)

hope i didn't confuse you.

Avatar

Avatar

SRenae

Avatar

SRenae

SRenae

17-09-2009

do you mean where are the textbox and checkbox located on my form or in the hierarchy?

I have the checkbox and textbox in their own subform.

if

(Checkbox1.rawValue==1)

     Textfield1.presence

="visible"

else

Textfield1.presence

="hidden"

Sorry that I'm being a pain!  I'm not well-versed in scripting if that isn't obvious!  😉

Avatar

Avatar

SRenae

Avatar

SRenae

SRenae

17-09-2009

This is the form I'm creating.

THANK YOU!!  🙂

Avatar

Avatar

xrum

Avatar

xrum

xrum

17-09-2009

can you attach a sample form?

Avatar

Avatar

SRenae

Avatar

SRenae

SRenae

17-09-2009

Thank you for your quick reply!  🙂  I'm getting an error message now.  The error reads Couldn't post data to ".

Any idea why?