Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

using javascript to make a text box invisible by clicking a radiobutton

Avatar

Avatar
Validate 1
Level 2
ibwaheemi
Level 2

Like

1 like

Total Posts

31 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
ibwaheemi
Level 2

Like

1 like

Total Posts

31 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
ibwaheemi
Level 2

18-11-2008

hi



my radiobuttons are for a persons title eg Mr Miss Mrs Ms and value 5 is for other.



when i click other i want a text box to appear that a user can write in, and if the user changes their mind after writing in the box i want the text box to disappear



you may of noticed i am new to java. this is the code i have used for my text box



topmostSubform.Page1.titleother::calculate - (JavaScript, client)



if (titlebox.rawValue == 5)

this.presence = "visible";

else

this.presence = "invisible";



this.rawValue;



i have tried variations of this script but it still doesnt work the way it should. i tried searching forums and help files but couild not find an answer to this simple problem... can anyone help

Replies

Avatar

Avatar
Boost 1
Level 4
Thomas_McConnac
Level 4

Likes

2 likes

Total Posts

134 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 4
Thomas_McConnac
Level 4

Likes

2 likes

Total Posts

134 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
Thomas_McConnac
Level 4

19-11-2008

Hi,



Its likely that the radio buttons are returning "other" instead of 5.



Try this line in your code to check:



xfa.host.messageBox(""+titlebox.rawValue);



It will bring up a prompt with the value in.



Tom

Avatar

Avatar
Validate 1
Level 2
ibwaheemi
Level 2

Like

1 like

Total Posts

31 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
ibwaheemi
Level 2

Like

1 like

Total Posts

31 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
ibwaheemi
Level 2

19-11-2008

thnaks for your post thomas i appreciate your help on this 🙂



yes it did put 'other' in my text box.



i managed to overcome the proble using a workaround, it isnt ideal but it works. i put a clickevent in the radiobuttons and changed the text box from calculated to optional