attr name in IE 11 appears as SubmitName
Hi folks,
I know it has been talked a lot on this issue but I need some info on how get rid of it. I've a form in which I've the possibility to add additional inputs through jquery by doing some cloning. Afterwards, I just do an attr on name but as mentioned on the topic name, it replaces it as SubmitName. So basically, I can't retrieve after submitting the form, all the values inside inputs which have name replaced by submitName.
here is a sample of my code:
- var uniqueLeg = 1;
- $('.addInfo').click(function() {
- var copy = $('#Info').clone(true,true);
- var formId = 'Info' + window.uniqueLeg;
- copy.attr('id', formId );
- copy.removeAttr('style');
- copy.find(':input#tripdate').each(function() {
- $(this).addClass('datepicker');
- var dateid = 'tripdate' + window.uniqueLeg;
- $(this).attr('id', dateid );
- $(this).attr('name', $(this).attr('name')+window.uniqueLeg );
- $(this).datepicker({ dateFormat: "dd/mm/yy" });
- });
- copy.find(':input#routingdep').each(function() {
- $(this).addClass('aptsearch');
- var dateid = 'routingdep' + window.uniqueLeg;
- $(this).attr('id', dateid );
- $(this).attr('name', $(this).attr('name')+window.uniqueLeg );
- $(this).autocomplete({source:'suggest_apt.php', minLength:3});
- });
- ....
- $('#trip').append(copy);
window.uniqueLeg++;
});
html code :
- <div id="trip">
- <TABLE id="Info" style="display:none" width="400px" border="0">
- <TR >
- <TD ><INPUT type="checkbox" class="delCheckLeg" name="chk"/></TD>
- <TD ><INPUT type="text" id="tripdate" name="tripdate"></TD>
- <TD ><INPUT type="text" name="deptime[]"/></TD>
- <TD ><INPUT type="text" id="routingdep" name="routingdep"/></TD>
- <TD ><INPUT type="text" id="routingarr" name="routingarr"/></TD>
- <TD ><INPUT type="text" name="fttime[]"/></TD>
- <TD ><INPUT type="text" name="pax[]"/></TD>
- </TR>
- </TABLE>
- </div>
So I've googled and find out several pages talking about it and giving as resolution to use the createElement or use javascript innerHTML. But I wasn't able to make them work on such code.
http://msdn.microsoft.com/en-us/library/ms534184.aspx
https://forum.jquery.com/topic/set-name-parameter-does-not-work-in-ie7
http://felipenmoura.org/articles/bug-on-ie-when-creating-elements-with-name-submitname
http://api.jquery.com/html/
What would you suggest to solve this issue? Use another browser than IE is not a solution :(
regards
PoY