[thelist] Radio selection showing results in text box

Ray Hill ray at opengrid.com
Thu Aug 30 18:55:58 CDT 2001


> When the user clicks on the radio button, I'd like the appropriate
> score for that radio button to show up in the corresponding text
> box automatically.  Anyone know how? :P

We just finished a page that does something very similar.  It uses
checkboxes instead of radio buttons, and changes the value in a single field
instead of one field per checkbox, but the JavaScript should be similar
enough to make it easy for you to pick apart and repurpose.

http://web2001.mobileplanit.com/

Click on the Palm Logo and submit the profile form to get to the modules
page, which is where the JavaScript can be found.  Just search for
'calculateFileSize()' to find the right script.  Since the majority of the
page is being generated through XSL, you'll have to put the carriage returns
back into place to make it legible.

Basically, you're just setting the value of a form element (the text field)
with whatever value you have assigned to it.  The trick for your version is
going to be making the target text field and the value into arguments you
can pass into the function.


--ray




More information about the thelist mailing list