wood burning stoves 2.0
The moose likes HTML, CSS and JavaScript and the fly likes Javascript and Struts Indexed Text Boxes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript and Struts Indexed Text Boxes" Watch "Javascript and Struts Indexed Text Boxes" New topic

Javascript and Struts Indexed Text Boxes

Matt Schulte

Joined: May 17, 2006
Posts: 4
Hello all, thanks for your help in advance.

I am trying to create a javascript that will change the value of a text box when a radio button is clicked. I have an array of beans containing a user and their status being written to the jsp page through the use of struts iterate. When the admin changes the status of the user by clicking a different radio button, I want the text field (to be hidden at a later date) to change to true so I will know in my action when a status has been changed.

Currently the javascript I have gives no errors, but does not change the value of the textboxes either. I have tried multiple ways of changing the values...all are provided in my code.



Any help on how to change that value would be great. thanks.
[ May 17, 2006: Message edited by: Matt S. ]
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
when you do


it is look for a form named name

you need to do

document.formName["theNameOfTheElement"].value = "true";

Matt Schulte

Joined: May 17, 2006
Posts: 4
Thank you Eric, it works great now!
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858

"Matt S.",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

JavaRanch Sheriff

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: Javascript and Struts Indexed Text Boxes
It's not a secret anymore!