Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
Using the s:submit tag in order to post data from a s:form that contanis a textfield named "id" doesn't in IE7.
After doing some debug I found a problem in the javascript generated by dojo plugin (dojo.js), specifically in the dojo.byId function. There, it looks for a form with the given id. At first it works well, but then it checks if the id of the found element is the same of the given id. If the form contains a textfield with the name "id", the function returns wrond value.
Here's the dojo source with some comments...
dojo.byId=function(id,doc){
if((id)&&((typeof id=="string")||(id instanceof String))){
if(!doc)
var ele=doc.getElementById(id);
//*************
// If you have a for with a textfield with the name "id" the
// test (ele.id!=id) always returns false....
//*************
if(ele&&(ele.id!=id)&&doc.all){
ele=null;
eles=doc.all[id];
if(eles){
//****************************
// Here's the problem ... "eles.length" is
// not the number of forms with the same id, but rather,
// the number of the inner elements of the form...
// textfields, for example
//****************************
if(eles.length){
for(var i=0;i<eles.length;i++){
if(eles[i].id==id)
}
}else
{ ele=eles; }
} }
return ele; }
return id; };
Some pieces of the source I coded:
<s:form id="formId" theme="ajax" namespace="/ajax" method="post" ...>
<s:textfield label="Id" name="id" cssClass="textfield"/>
</s:form>
the submit button (outer):
<s:submit formId="formId" targets="list" theme="ajax" .../>
the s:div
<s:div id="list" ...></s:div>