Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
-2
rated 0 times [  2] [ 4]  / answers: 1 / hits: 21035  / 11 Years ago, sat, december 21, 2013, 12:00:00

I have this HTML form



<form name=nextform action=anotherpage.php method=post enctype=multipart/form-data>
<input name=pinid id=pinid type=hidden>
<input type=submit name=submit id=post value=Lets Go class=formButtonMap>
</form>


pinid dynamically gets a value using JavaScript. When it gets a value I alert it and it works.



But, when I click the Lets Go button, nothing happens. I see the Internet Explorer loading for a couple of minutes and then I get the message “The webpage does not respond”. If I hit refresh it goes to anotherpage.php but the values from the form did not arrive to the server.



Rarely shows this message:




Visual Studio Just-In-Time Debugger



An unhandled win32 exception occured in iexplorer.exe [688]



Possible Debuggers :



New Instance of Microsoft Visual Studio 2012




This behavior is observed only in Internet Explorer 11.0.2. The form works in older versions of Internet Explorer and also in Chrome and Firefox. I get no errors in IE’s console.



Here is the JavaScript code, placed above the form:



// called when another button is clicked - basicaly is websockets
function save() {
var so = new WebSocket(ws://localhost:8000);
so.onerror = function (evt) {
alert('problem');
}

if (sara == 'LINES') {
so.onopen = function() {
so.send(JSON.stringify({
command: 'insertAll',
name: document.getElementById('name').value
}));
}
}

if (sara == 'POLY') {
so.onopen = function() {
so.send(JSON.stringify({
command: 'insertHalf',
name: document.getElementById('name').value
}));
}
}

so.onmessage = function (evt) {
var received_msg = evt.data;

document.getElementById(next).style.display = block;
document.getElementById(name).value = ;
document.getElementById(descr).value = ;
clearLinks();

document.getElementById(pinid).value = received_msg;
alert(document.getElementById(pinid).value); // works

so.close();
}
}


I tried to edit the code using document.getElementById(nextform).submit();, problem is still there.



Is it me? Is it a bug? What am I missing?


More From » html

 Answers
19

I believe this is a bug when setting form values to empty in IE.





I would suggest trying a different method to resetting the form values, I have used this method in the past:



document.getElementById('name').parentNode.innerHTML = '';

[#73615] Friday, December 20, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
masonm

Total Points: 167
Total Questions: 87
Total Answers: 103

Location: Rwanda
Member since Wed, Jun 8, 2022
2 Years ago
masonm questions
;