These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Mark radio button based on value of textfield

DianaL
Registered: Nov 17 2009
Posts: 80
Answered

Hi All,

I have one textfield and one radio button.

if i type for example in textfield 100 the radio button should be marked if it's not 100 then it should be not marked.

I use this code in java scripts in change when i click on textfield, but it doesnt work. can anyone help me??

if (textField.rawValue = 100) {

radiobutton.rawValue = 1;

} else {

radiobutton.rawValue = 0;

}

Thank you in advance!!

Diana

xrum
Registered: Feb 25 2009
Posts: 124
put it on exit event

and it should be == 100 not = 100
DianaL
Registered: Nov 17 2009
Posts: 80
I put it to exit event and ==100 but unfortunately it still doesnt work...
xrum
Registered: Feb 25 2009
Posts: 124
on exit, means you have to click out of the text box for the code to execute. did you click out?


if (this.rawValue == "100")
CheckBox1.rawValue=1
else
CheckBox1.rawValue=0

this works for me.

attach a sample form if you can.
DianaL
Registered: Nov 17 2009
Posts: 80
yes, i did everything you said. put in exit in java scripts this coding

if (radiobutton.rawValue == "100") {
textField.rawValue = 1;
}else {

textField.rawValue = 0;
}
and then i typed in the field 100 and clicked out of the textfield, but it doestn work.

thank you for ur help.

please send me an example!!

Diana
DianaL
Registered: Nov 17 2009
Posts: 80
oh sorry i misunderstood u i will send u an example :-)
DianaL
Registered: Nov 17 2009
Posts: 80
my email is diana-lu [at] web [dot] de
xrum
Registered: Feb 25 2009
Posts: 124
http://www.sendspace.com/file/tiuebj
xrum
Registered: Feb 25 2009
Posts: 124
haha, sorry, i just shared it on sendspace, let me know if you have problems getting it :)
DianaL
Registered: Nov 17 2009
Posts: 80
Thank you soooooooo much!!!!!!!!!
it works perfectly :-))
DianaL
Registered: Nov 17 2009
Posts: 80
another quick question:
i have a dropdown list and i want to select for example "a" AND mark a checkbox then a textfield2 should be visible. I did this code in change event in checkbox, but it doesnt work.
what is wrong?


if (dropdown.rawValue == "a") && (checkbox.rawValue > 0)
textfield2.presence = "visible";

thank you!!!!

Diana
xrum
Registered: Feb 25 2009
Posts: 124
checkbox.rawValue == 1

>0 will not work
DianaL
Registered: Nov 17 2009
Posts: 80
it doesnt work checkbox==1...it works with checkbox > 0 but without dropdown.rawValue=="a"
xrum
Registered: Feb 25 2009
Posts: 124
http://www.sendspace.com/file/dp57yi

:)
DianaL
Registered: Nov 17 2009
Posts: 80
thank you very much!!!!!!!!!!!!!!!!!! :-))

it works, but if i put the code in checkbox in exit. is there a possibility to make a textfield2 appear without a 2. clicking outside of the fields ?

thx,
Diana
xrum
Registered: Feb 25 2009
Posts: 124
huh? what 2?
DianaL
Registered: Nov 17 2009
Posts: 80
in few minutes i upload a form and show u what i mean ;-)
DianaL
Registered: Nov 17 2009
Posts: 80
am back again...at this forum i attached the form:-)


http://forums.adobe.com/message/2421147

thanks again!!
Diana
DianaL
Registered: Nov 17 2009
Posts: 80
here is finally the attached form:

https://acrobat.com/#d=x273XZc4Qd8BjSK-gL9V0w

first step: if i click in dropdownlist "a" and put in numeric field a number bigger than 99 the, checkbox should be marked and second step: a textfield1 should be visible.



the first step works perfectly, you have already helped me, but the second doesnt work.



do u have any idea why?



thanks!!

Diana