This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes how to add checkbox values to a javascript array? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to add checkbox values to a javascript array?" Watch "how to add checkbox values to a javascript array?" New topic
Author

how to add checkbox values to a javascript array?

Ajay Xavier
Ranch Hand

Joined: Jan 03, 2005
Posts: 109
hi,

i hope this is one of the right places to post this query.

In my JSP page i have 10 Checkboxes (generated through <html:multibox> .

In this 10 checkboxes some should be user editable and some should not be. This is determined by a value associated with the form bean. Initally during the page load all the 10 checkboxes will be selected by default.

For some reason, I need to keep track of editable and non editable text boxes. I thought of adding the values of the non editable check boxes to an array in javascript.

How to intialize the array with the non editable checkbox values?

Regards,
Ajay
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The following code looks at every checkbox on the page and puts the value of each into an array if it is unchecked.


Merrill
Consultant, Sima Solutions
Ajay Xavier
Ranch Hand

Joined: Jan 03, 2005
Posts: 109
Hi,

Thanks for your reply.

In my case all the check boxes will be checked initially so if try to store the values based
on the "checked" status it will return the values of all the check boxes. So i guess i cannot
proceed in that way.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to add checkbox values to a javascript array?