Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

how to add checkbox html tag?- urgent!

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to add a checkbpx in front of every row of this table? Please help!
---------------------------------
<table border="0" cellspacing="0" cellpadding="1" align="center">
<tr class="tblcaption">
<INPUT TYPE=CHECKBOX NAME="maillist">
<logic:iterate indexId="colCtr" id="col" name="myInfo" property="sortedList" type=" com.api.ColumnInfo">
<logic:equal value="true" name="col" property="visible">
<TD>
<bean:message key="<%=col.getMyLabelKey()%>" bundle="MyResources"/>
</TD>
</logic:equal>
</logic:iterate>
</tr>
<tr class="tblcellseparator">

</tr>
</table>
 
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume you want to put a checkbox where you have the
<INPUT TYPE=CHECKBOX NAME="maillist">
tag? You need to place that inside of a set of table data tags:

In your code sample, the input tag is between table row tags, but not inside a table data tag. I'm not sure what the (X)HTML specifications say to do (if anything since it is technically incorrect markup), but most browsers will render anything placed between <table> tags, but not inside of <td> (table data) or <th> (table header) tags before the table. Some browser may even ignore such erroneous entities.
 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to state that with html tag in struts?
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

That would render an input tag of:

<input type=�checkbox� name=�foo� value=�on�>

The property attribute is the only required attribute for the <html:checkbox> tag. You can look at the what the various other attributes are and what they are used for in the documentation available at: http://struts.apache.org/userGuide/struts-html.html#checkbox
 
Grow a forest with seedballs and 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
    Bookmark Topic Watch Topic
  • New Topic