David_Pazos
asked on
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:
So I've googled and find out several pages talking about it and giving as resolution to use the createElement(), html() 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
David
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:
$('.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});
});
....
So I've googled and find out several pages talking about it and giving as resolution to use the createElement(), html() 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
David
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Worked like a charm!!!
thanks a lot!
this is the latest version. I had issue with the class in the replaceWith
thanks a lot!
this is the latest version. I had issue with the class in the replaceWith
$(this).replaceWith("<input type='" + $(this).attr("type") + "' id='routingdep" + window.uniqueLeg + "' name='" + $(this).attr("name") + window.uniqueLeg + " />");
$(this).addClass('aptsearch');
$(this).autocomplete({source:'suggest_apt.php', minLength:3});
ASKER
Open in new window
Thanks a lot for your suggestion, I'll try it immediatelly. I keep you posted :)