document.createElement was working in all browsers other than FF.I changed this part
1: var newElement = document.createElement("<input name='"+elementName+"' id='" + elementName + "' type='hidden'>");
to this:
1: var newElement = document.createElement("input");
2: newElement.setAttribute('name',elementName);
3: newElement.setAttribute('id',elementName);
4: newElement.setAttribute('type','hidden');
and i got it working in all browsers
http://www.dustindiaz.com/add-and-remove-html-elements-dynamically-with-javascript/
http://www.eggheadcafe.com/community/aspnet/3/41127/firefox-createelement--a.aspx
It works perfectly!, thanks!
ReplyDelete