[ https://issues.apache.org/jira/browse/TRINIDAD-713?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Winer updated TRINIDAD-713: -------------------------------- Resolution: Fixed Fix Version/s: 1.0.4-core Assignee: Adam Winer Status: Resolved (was: Patch Available) > Using "name" as the id for a component breaks form submission. "name" appears > to be an undocumented reserved identifier. > ------------------------------------------------------------------------------------------------------------------------ > > Key: TRINIDAD-713 > URL: https://issues.apache.org/jira/browse/TRINIDAD-713 > Project: MyFaces Trinidad > Issue Type: Bug > Components: Components > Affects Versions: 1.2.2-core > Reporter: Mike Hanafey > Assignee: Adam Winer > Fix For: 1.0.4-core > > Attachments: patchInvalidIdNameComponent.patch > > > Using the trinidad-blank as an example, if the the id of the input field in > "page1.jspx" is changed from: > <tr:inputText label="Your name" id="input1" > value="#{helloWorldBacking.name}" required="true"/> > to: > <tr:inputText label="Your name" id="name" > value="#{helloWorldBacking.name}" required="true"/> > nothing happens when the "press me" button is pushed (the form is not posted). > The following JavaScript error is reported: > Error ``TypeError: a0.split is not a function'' [xs] in file > ``http://localhost:8080/trinidad/adf/jsLibs/Common1_2_2.js'', line 4512, > character 0. > In the code fragment below "a0" has been resolved to the HTMLFormElement, but > apparently because the form contains a button element named "name", "a0.name" > does not return the form name, but instead the button instance, and "split" > is not a method on HTMLButtonElement. > 4861 if(!a0) > 4862 return false; > 4863 var a6=window["_"+_getJavascriptId(a0.name)+"Validator"]; > 4864 if(a6==(void 0)) > function _getJavascriptId(a0) > 4511 { > 4512 return a0.split(':').join('_'); > 4513 } > Is there a way in JavaScript to avoid this name conflict? It does not seem > reasonable it is illegal to add an element called "name" to a form. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.