Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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
  #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/
  #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

  #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




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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.