New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using array syntax generates invalid id [SPR-2380] #7069
Comments
Fried Hoeben commented Seems quite easy to change generated id to array0, which would be valid. In AbstractDataBoundFormElementTag Of course a workaround is to specifiy the id explicitly... |
Juergen Hoeller commented I've finally addressed this for Spring 2.5, so that no custom ids have to be specified in such a case anymore (in order to get valid HTML ids). Thanks for raising this issue again, Fried! Juergen |
Pablo commented The same is happening in spring 2.5 with freemarker. |
Przemek Ch commented The same is happening in spring 3.0.6 with freemarker. < generates <input id="additionalSalesList[1].saleResult.policyId" class="policyId_0" type="text" value="" name="additionalSalesList[1].saleResult.policyId"> |
Stevo Slavić commented This issue covered Spring form tag library generated id on JSP views/forms (see example in issue description), fix works OK, so IMO this issue shouldn't have been reopened, and should be closed now again. A separate ticket, #13374, covers related issue on FreeMarker views/forms. |
Rossen Stoyanchev commented Issue was resolved a while ago for JSP tags. A separate ticket tracks the same for Freemarker #13374. |
sivakrishna beerala commented I am getting the same issue in spring web 3.0.5.please rcheck it once. |
Stevo Slavić commented Sivakrishna, are you using Freemarker? If so, then this is fixed in 3.2 M1 which is not released yet, but you have 3.2 snapshot builds in Spring snapshot repository or you can build latest Spring yourself (see this for instructions). Otherwise, e.g. if it's issue in JSP views, feel free to provide sample reproduction project. If it's neither in JSP nor Freemarker, but in some other view technology instead, file a new JIRA ticket and attach a sample reproduction project. See this guide on contributing Spring framework issue reproduction projects: https://github.com/SpringSource/spring-framework-issues#readme |
sivakrishna beerala commented No Iam not using Freemarker.i am using it in spring mvc jsp file itself.after checking the genarated html file its showing mailsList0,mailsList1 .... and so on |
Stevo Slavić commented Sivakrishna, this is expected behavior, result of a fix. IMO this issue can be closed as fixed in 2.5. |
Chris Beams commented Re-resolving in light of comments. |
sivakrishna beerala commented Hi I intialized my array object to how much size i needed in form class then my problem solved. |
spring-projects-issues commentedAug 3, 2006
•
edited
Bjørn Sættem opened SPR-2380 and commented
The tag <form:input path="array[0]" />
generates
<input id="array[0]" name="array[0]" type="text" value=""/>
but "[" and "]" are invalid in an identifier name. Ref. http://www.w3.org/TR/html4/types.html#type-name
Affects: 2.0 RC2
Issue Links:
2 votes, 3 watchers
The text was updated successfully, but these errors were encountered: