Results 1 to 3 of 3

Thread: Class or ID in the form tag (JSP)

  1. #1
    Join Date
    May 2008
    Posts
    13

    Class or ID in the form tag (JSP)

    I would have liked to style a drop down box, and therefore have a class or ID on the various options. In plain html, it is just to put this on, but how to do this in a jsp tag file?

    I paste the code for my roof file in here:
    Code:
    <c:forEach items="${models}" var="x"> 
    <c:choose> 
    <c:when test="${x.disabled}"> 
    <form:option value="${x.id}" disabled="true"> 
    <spring:message code="${x.id}" text="${x.name}" /> 
    </ form: option> 
    </ c: when> 
    <c:otherwise> 
    <form:option value="${x.id}"> 
    <spring:message code="${x.id}" text="${x.name}" /> </ form: option> 
    </ c: otherwise> 
    </ c: choose> 
    </ c: foreach>
    I put a class or ID on one of the optional elements, then this error:
    Attribute class invalid for tag option according to TLD

    Is there a way you can get around this? Since I am reasonably new in jsp I tried to write a simple select (drop down box) in pure html into the code, but then leaves it to not come up with when I submitt form.

  2. #2
    Join Date
    May 2008
    Posts
    2,297
    Without knowing too much about Spring may try to attribute cssClass = "class name". According tld'en is the way to put a css class in a form-factor on. Whether it works with the other elements I do not know.

  3. #3
    Join Date
    May 2008
    Posts
    13
    Does it not, unfortunately, but thanks for your help.

Similar Threads

  1. Replies: 5
    Last Post: 25-05-2011, 10:21 PM
  2. Replies: 2
    Last Post: 02-05-2011, 07:06 AM
  3. How to Auto Populate fields from sub form to form?
    By mich43 in forum Windows Software
    Replies: 6
    Last Post: 09-11-2010, 11:29 PM
  4. Procedure in VB to create form inside another form
    By Jalabala in forum Software Development
    Replies: 3
    Last Post: 16-11-2009, 02:14 PM
  5. Problem reloading MDI child form in main form.
    By AFFAN in forum Software Development
    Replies: 3
    Last Post: 30-01-2009, 09:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,100,342.71177 seconds with 16 queries