• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

plzz solve this problem..???

 
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I have a page with 2 things.(checkbox and file name corresponding to it).
I also have a link called "select all" which on clicking makes all uncheck boxes checked.

I have a button like sumbit. i want that on clicking on this button, file name corresponding to all checked boxes should go to cooresponding actionForm class after which i can use that in action class for manipulation.....

can nybody tell me how to doo it???
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You could use <html:multibox> for this, and the property defined could be a String array, in the form bean class.

Hope this helps.


Liju
 
Himanshu Rawat
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

can u just tell me how will i then select all check boxs(checked) on clicking select all link...
 
Himanshu Rawat
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see in html by default we can be check boxes checked using this..

html code:-
<input type="checkbox" name="C1" value="ON" checked>

how can we do it in <html:multibox/> ???
ny idea how to do it???
 
Liju Cherian
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the case of <html:multibox>, we can use JavaScript to check it, as displayed below -

where testForm is the formName, userId is the property and [0] signify's the index 0. If u were to view the source in the browser, u could observe that <html:mulitbox> tag is converted into the traditional <input type="checkbox"> tag.

Hope this helps.


Cheers,
Liju
 
Himanshu Rawat
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

u r right bt it will check the box on some event like onclick()...bt how to do when the page loads..for eg..i want that when page loads..all check boxes should be by default checked...in html we can do it by "checked" property...

Is there ny default property in <html:mutlibox>???
 
Liju Cherian
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can run the script, at body onload. ie u can call a function with the help of body onload parameter, as follows



<script>
function runScript() {
document.testForm.userId[0].checked='true';
document.testForm.userId[1].checked='true';
}

</script>


<body on load="runScript()">
...

</body>



Hope this resolves ur situation.


Cheers,
Liju

P.S.: There is no space between on & load in the body tag. Couldn't post it as one word.
[ April 05, 2006: Message edited by: Liju Cherian ]
 
Himanshu Rawat
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx ...it worked..for me....
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!