Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Value from radio button changes property of text box to "required"

Status
Not open for further replies.

Worsty

Programmer
Oct 27, 2004
34
US
I have a radio button group and when radiobutton1 is selected and had a value of "1" then I would like to make txtbox1 "required".

Can someone help me with the code?

Thanks
 
Write an onsubmit for the form element and in it put a condition on the validation routine for the text box that only executes when the radio button equals 1.


Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Define "required". If you have some code for requiring certain fields, you will need to share that with us. If you only want to change the value of the text box, that can easily be done with an onclick event.

----
 
The form I'm creating is a Acrobat Designer 9.0 form. In the properties of the form fields you can make the field "required" which then will show a outlined box around the form field to give a visual to the user that the form field must be filled in. The issue is that the form field is only "required if one of the radio buttons in the group I described above is selected. So what I wanted to do is to change the property of the text box when the value of radiobutton1 is equal to "1". I put the following code behind the text box:

form1.#subform[0].txtTopSecretID::validate - (JavaScript, client)
if(NewUser.value = "1" then
txtTopSecretID.validate = "true"

If the value isn't "1" then I don't want it to be required. I only got this far. This doesn't work. Can anyone help out with what I'm trying to accomplish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top