Sachin Ag

Greenhorn
+ Follow
since Sep 15, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sachin Ag

I tried something like this:


It gave me an alert of [object] and not the value though it's value was true. Can you please suggest me some other alternative.
Also how will I come to know the length of the arraylist in javascript.

Regards
Sachin
Hello

I have an arraylist of objects and am using logic:iterate on the jsp page to display the table contents dynamically. My object has 3 fields, one checked variable for checkbox, one description and one value. What i want is that when submit button is clicked, then in javascript i need to do some validations. In javascript i want to get all the checkbox selected in the table and the corresponding description and value of that row.

I didn't find any way to access java arraylist in Javascript. Somewhere i read convert arraylist to javascript array but didn't find any concrete example.

Please do provide me some example of this scenario.
Some code snippets needed.
Thanks a lot.


Regards
Sachin
13 years ago
Sir i have tried all possible way. Probably we need to iterate through something and then check individually if the checkbox was selected.
I tried to fetch something like this : document.forms[0].details[0].checked -- > this gave me error
document.forms[0].details -- > this gave me undefined
document.forms[0].availablePaymentDetailsList --> undefined
document.forms[0].availablePaymentDetailsList.length --> error

So please let me know with an working example.

Regards
Sachin
But the question here is how do i call the checked property in javascript.
Like something we have document.forms[0]. something something..
How do i get the value. There will be multiple checkboxes and i want to know the checkboxes selected.
Will be grateful if you provide some code snippet based on my example.

Regards
Sachin
Hello

I have a list of checkbox generated dynamically using logic:iterate. Here's the code :


What i want is that in the javascript to obtain the checkbox selected after i hit submit.

The view source part of that page looks like this..



Please let me know how to proceed.

Thanks
Sachin