PenguinMan98
07-09-2007, 07:40 PM
Greetings fellow Coders!
I have encountered an interesting bug that I have been 100% unsuccessful in finding help for using Google.
Very simply: I use this code to create a form submit button:
newInputElement = document.createElement("input");
newInputElement.type = "submit";
newInputElement.name = "form_submit";
newInputElement.value = "No! Don't delete this "+pageIdentifier+" Record";
delSpan.appendChild(newInputElement);
or I also tried:
newInputElement = document.createElement("input");
newInputElement.setAttribute('type','submit');
newInputElement.setAttribute('name','form_submit');
newInputElement.setAttribute('value',"Yes! Delete this "+pageIdentifier+" Record");
delSpan.appendChild(newInputElement);
Both code snippets are successful at correctly creating the button on the page in IE and Firefox. The problem comes when I click the button. In IE it submits the form correctly but in Firefox, nothing happens.
I checked the DOM in FireFox using the DOM inspector and found that the button was where it was supposed to be, had the attributes it should have and was located inside a <form>. I'm completely stumped.
Any help would be greatly appreciated. :thumbsup:
I have encountered an interesting bug that I have been 100% unsuccessful in finding help for using Google.
Very simply: I use this code to create a form submit button:
newInputElement = document.createElement("input");
newInputElement.type = "submit";
newInputElement.name = "form_submit";
newInputElement.value = "No! Don't delete this "+pageIdentifier+" Record";
delSpan.appendChild(newInputElement);
or I also tried:
newInputElement = document.createElement("input");
newInputElement.setAttribute('type','submit');
newInputElement.setAttribute('name','form_submit');
newInputElement.setAttribute('value',"Yes! Delete this "+pageIdentifier+" Record");
delSpan.appendChild(newInputElement);
Both code snippets are successful at correctly creating the button on the page in IE and Firefox. The problem comes when I click the button. In IE it submits the form correctly but in Firefox, nothing happens.
I checked the DOM in FireFox using the DOM inspector and found that the button was where it was supposed to be, had the attributes it should have and was located inside a <form>. I'm completely stumped.
Any help would be greatly appreciated. :thumbsup: