File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Javascript and Struts Indexed Text Boxes

Matt Schulte
Greenhorn

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.

javascript:



Jsp/Struts


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

Joined: Nov 08, 2001
Posts: 15376
    
    6
when you do

document.name.value="true";

it is look for a form named name

you need to do

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

Eric
Matt Schulte
Greenhorn

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

Joined: Jan 10, 2002
Posts: 60822
    
  65

"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.

Thanks!
bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javascript and Struts Indexed Text Boxes
 
Similar Threads
How to get property value for IF?
logic:iterate
html:radio
Arraylist in JSP with Html radio
using Multiple submit buttons.