Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 12th, 2006, 01:31 AM
Authorized User
 
Join Date: Aug 2006
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to sachin.tathod
Default checkbox checked by default by html:checkbox

Hi

can any one tell me how to make checkbox checked by default by <html:checkbox> </html:checkbox> ??

Plz note :- I can make it by using following .

 <input type="checkbox" name="showRewardProgram" class="checkbox" checked/>

But i want to use struts tag <html:checkbox> explicitly .

Thanx

Sachin




Thanks and Regards,
SACHIN S.TATHOD
Patni Computer System Ltd.
Magarpatta City, Cyber City,
Tower 3,Level I & II,
Hadapsar,Pune - 411028
Mobile No:- +91-9881239401
Email ID:- sachin.tathod@patni.com
__________________
Thanks and Regards,
SACHIN S.TATHOD
Patni Computer System Ltd.
Magarpatta City, Cyber City,
Tower 3,Level I &amp; II,
Hadapsar,Pune - 411028
Mobile No:- +91-9881239401
Email ID:- sachin.tathod@patni.com
Reply With Quote
  #2 (permalink)  
Old August 16th, 2006, 03:37 AM
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Sachin,

You just have to set the property that the checkbox is linked to to true before you forward to the JSP. For example, if you have <html:checkbox property="foo">, inside a form named myForm, do myForm.setFoo(true) inside your Action.

Jon Emerson
http://blogs.adobe.com/jon.emerson/
Reply With Quote
  #3 (permalink)  
Old November 14th, 2006, 06:38 PM
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How can i enable check box by default in struts. Pls give the sol ASAP

Reply With Quote
  #4 (permalink)  
Old December 4th, 2006, 03:41 PM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks panacea!

Your suggestion worked for me.

I just did the following steps:
1. property "foo" should be boolean type in the ActionForm class
2. set foo to true before the jsp is generated, I placed setFoo(true)on my init() method.

thanks


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
struts-html: checkbox default checked RatanKumar Struts 1 November 5th, 2007 05:49 AM
Checkbox checked all mateenmohd Javascript 1 January 2nd, 2007 06:19 AM
Checkbox checked? ninel ASP.NET 2.0 Professional 1 April 12th, 2006 10:50 PM
Datalist with checkbox -- how to default checked? jobber99 ASP.NET 1.0 and 1.1 Basics 1 January 30th, 2006 02:52 PM
allow only one checkbox to be checked! morpheus HTML Code Clinic 5 April 15th, 2004 10:59 AM



All times are GMT -4. The time now is 09:19 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.