You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/11/10 19:05:27 UTC

DO NOT REPLY [Bug 24573] New: - html:select uses options from previous select

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24573>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24573

html:select uses options from previous select

           Summary: html:select uses options from previous select
           Product: Struts
           Version: 1.1 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Custom Tags
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: hurle@gmx.de


When using the struts:html taglib I found a strange behaviour when using
html:select in a html:form the following code snippet represents my code:

  			<html:select property="month" onchange="setDate()">
  				<option value="Jan"><bean:message key="month.1"/> </option>
  				<option value="Feb"><bean:message key="month.2"/> </option>
  				<option value="Mar"><bean:message key="month.3"/> </option>
  				<option value="Apr"><bean:message key="month.4"/> </option>
  				<option value="Mai"><bean:message key="month.5"/> </option>
  				<option value="Jun"><bean:message key="month.6"/> </option>
  				<option value="Jul"><bean:message key="month.7"/> </option>
  				<option value="Aug"><bean:message key="month.8"/> </option>
  				<option value="Sept"><bean:message key="month.9"/> </option>
  				<option value="Oct"><bean:message key="month.10"/> </option>
  				<option value="Nov"><bean:message key="month.11"/> </option>
  				<option value="Dec"><bean:message key="month.12"/> </option>
  			</html:select>
			<bean:message key="label.year"/>
  			<html:select property="year" onchange="setDate()"/>


I would expect the "year"-selection to be empty, but in fact the generated html
code looks like this:


Monat
  			<select name="month" onchange="setDate()"><option value="Jan">Januar </option>
  				<option value="Feb">Februar </option>

  				<option value="Mar">März </option>
  				<option value="Apr">April </option>
  				<option value="Mai">Mai </option>
  				<option value="Jun">Juni </option>
  				<option value="Jul">Juli </option>
  				<option value="Aug">August </option>

  				<option value="Sept">September </option>
  				<option value="Oct">Oktober </option>
  				<option value="Nov">November </option>
  				<option value="Dec">Dezember </option></select>
			Jahr
  			<select name="year" onchange="setDate()"><option value="Jan">Januar </option>
  				<option value="Feb">Februar </option>

  				<option value="Mar">März </option>
  				<option value="Apr">April </option>
  				<option value="Mai">Mai </option>
  				<option value="Jun">Juni </option>
  				<option value="Jul">Juli </option>
  				<option value="Aug">August </option>

  				<option value="Sept">September </option>
  				<option value="Oct">Oktober </option>
  				<option value="Nov">November </option>
  				<option value="Dec">Dezember </option></select>


The options from "month"-selection is also used in the "year"-selection! The
behaviour only occurs when I write the select like this:
<html:select property="year" onchange="setDate()"/>
NOT when writing like this:
<html:select property="year" onchange="setDate()"></html:select>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org