471,598 Members | 1,241 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,598 software developers and data experts.

ie : form submits happening multiple times

Plater
7,872 Expert 4TB
I'm going to stab myself in the face.
I have a page with a single form.
Regular old html.
There are a few checkboxes and textboxes and and two submit buttons (I hope that's not the issue...)
The form submits to itself (I control the backend so I handle it)

When I click the submit button, the form is submitted and I get my page back with a "form submitted" text in a certain place.
As SOON as it finishes loading, it automatically submits itself again.
Using a packet watcher I can see that the request seems to be identical. Both use POST and contain the same content data.
Before that NEW request has finished loaded, it loads the page a THIRD time, this time using a GET request and no content data.

This is very aggrivating. It only appears to happen in ie (I've only test on ie6 though). There is no javascript on the page.

A few more notes:
The page is in a privleged zone so the AUTH header gets sent (it's in there and validated just fine, the "200 ok" is returned to each request without a challenge)
The pages are all marked as no-cache

Anyone heard of this? I gave a quick check on the net and got one hit back to a newsgroup but nothing was resolved.
Nov 29 '07 #1
14 3605
Death Slaught
1,137 1GB
I can't tell where or what your problem is without your code, so please post it.

Thanks, Death
Nov 29 '07 #2
Plater
7,872 Expert 4TB
It's just a basic form?
Expand|Select|Wrap|Line Numbers
  1. <form method="post" name="nalarmsconfig" id="alarmsconfig">
  2.  
  3. <input type="checkbox" name="nAlarmsEnabled" id="AlarmsEnabled"  checked="checked"  />
  4. <textarea name="nEmailList" id="EmailList" cols="40" rows="8" >user@domain.com</textarea><br />
  5. <select name="nAlarmsStart" id="AlarmsStart">
  6.     <option value="0">12:00 AM</option>
  7.     <option value="0">12:00 AM</option>
  8.     <option value="60">1:00 AM</option>
  9.     <option value="120">2:00 AM</option>
  10.     <option value="180">3:00 AM</option>
  11.     <option value="240">4:00 AM</option>
  12.     <option value="300">5:00 AM</option>
  13.     <option value="360">6:00 AM</option>
  14.     <option value="420">7:00 AM</option>
  15.     <option value="480">8:00 AM</option>
  16.     <option value="540">9:00 AM</option>
  17.     <option value="600">10:00 AM</option>
  18.     <option value="660">11:00 AM</option>
  19.     <option value="720">12:00 PM</option>
  20.     <option value="780">1:00 PM</option>
  21.     <option value="840">2:00 PM</option>
  22.     <option value="900">3:00 PM</option>
  23.     <option value="960">4:00 PM</option>
  24.     <option value="1020">5:00 PM</option>
  25.     <option value="1080">6:00 PM</option>
  26.     <option value="1140">7:00 PM</option>
  27.     <option value="1200">8:00 PM</option>
  28.     <option value="1260">9:00 PM</option>
  29.     <option value="1320">10:00 PM</option>
  30.     <option value="1380">11:00 PM</option>
  31. </select><br />
  32. <select name="nAlarmsStop" id="AlarmsStop">
  33.     <option value="1080">6:00 PM</option>
  34.     <option value="0">12:00 AM</option>
  35.     <option value="60">1:00 AM</option>
  36.     <option value="120">2:00 AM</option>
  37.     <option value="180">3:00 AM</option>
  38.     <option value="240">4:00 AM</option>
  39.     <option value="300">5:00 AM</option>
  40.     <option value="360">6:00 AM</option>
  41.     <option value="420">7:00 AM</option>
  42.     <option value="480">8:00 AM</option>
  43.     <option value="540">9:00 AM</option>
  44.     <option value="600">10:00 AM</option>
  45.     <option value="660">11:00 AM</option>
  46.     <option value="720">12:00 PM</option>
  47.     <option value="780">1:00 PM</option>
  48.     <option value="840">2:00 PM</option>
  49.     <option value="900">3:00 PM</option>
  50.     <option value="960">4:00 PM</option>
  51.     <option value="1020">5:00 PM</option>
  52.     <option value="1080">6:00 PM</option>
  53.     <option value="1140">7:00 PM</option>
  54.     <option value="1200">8:00 PM</option>
  55.     <option value="1260">9:00 PM</option>
  56.     <option value="1320">10:00 PM</option>
  57.     <option value="1380">11:00 PM</option>
  58. </select><br />
  59. <input type="checkbox" name="nEnablePowerFailure" id="EnablePowerFailure"  checked="checked" /> 
  60. <input type="checkbox" name="nEnableSagSurge" id="EnableSagSurge" checked="checked" /> 
  61. <input type="text" name="nSagThresh" id="SagThresh"  value="0"/>
  62. <input type="text" name="nSurgeThresh" id="SurgeThresh"  value="0"/>
  63. <input type="checkbox" name="nEnableNGVoltage" id="EnableNGVoltage" checked="checked" />
  64. <input type="text" name="nNGMAX" id="NGMAX"  value="0"/>
  65. <input type="checkbox" name="nEnableTransPeak" id="EnableTransPeak" checked="checked" />
  66. <input type="text" name="nTransSplit" id="TransSplit"  value="0"/>
  67. <input type="text" name="nTransShort" id="TransShort"  value="0"/>
  68. <input type="text" name="nTransLong" id="TransLong"  value="0"/>
  69.  
  70.  
  71. <input type="checkbox" name="nEnableTemp" id="EnableTemp" checked="checked" />
  72. <input type="text" name="nMinTemp" id="MinTemp"  value="0"/>
  73. <input type="text" name="nMaxTemp" id="MaxTemp"  value="0"/>
  74. <input type="checkbox" name="nEnableHumidity" id="EnableHumidity" onclick="DoCheck(this);"  checked="checked" />
  75. <input type="text" name="nMinHumid" id="MinHumid"  value="0"/>
  76. <input type="text" name="nMaxHumid" id="MaxHumid"  value="0"/>
  77. <input type="checkbox" name="nEnableAirP" id="EnableAirP" onclick="DoCheck(this);"  checked="checked" />
  78. <input type="text" name="nMinAirP" id="MinAirP"  value="0"/>
  79. <input type="text" name="nMaxAirP" id="MaxAirP"  value="0"/>
  80.  
  81. <input type="submit" name="nbtSave" id="btSave" value="Save" />
  82. <input type="submit" name="nbtTrigger" id=btTrigger" value="Trigger/Test" />
  83. </form>
  84.  
There is no action in the FORM because it posts back to itself.
There are two submits buttons, but the value of the NON-clicked one is not passed so it doesn't appear to be getting triggered.
The problem only seems to occur when the checkboxes are checked, as opposed to not checked?
Nov 30 '07 #3
Death Slaught
1,137 1GB
On your 82nd line of code you're missing a " qoute in your id.

Thanks, Death

PS - if you want the form to submit to itself you have to give it the action attribute.

action="nameOfFile.html"
Nov 30 '07 #4
Plater
7,872 Expert 4TB
good eye on that id, I'd missed it myself.
I made both of those changes, unfortunatly it's still doing it.

It's related to content size somehow. I just tested it with one textarea. A small amount of text and it doesn't do it. A LARGE amount of text and it does the POST/POST/GET request pattern.
Nov 30 '07 #5
Death Slaught
1,137 1GB
I don't know what to tell you. Have you tried validating it?

- Death
Dec 1 '07 #6
Plater
7,872 Expert 4TB
I got a video cap of what it is doing. (It's not exactly the same every time)
You will see it reload a blank page (with background color) (Uses the POST from the form)
Then start to reload the page correctly, with the words "Settings saved" at the top, but stop before it completely loads it.(Uses POST method still)
It then will make a GET request for the page and let it load entirely.

Unfortuantly it is too big to attach:
FormSubmitWoes
Dec 4 '07 #7
drhowarddrfine
7,435 Expert 4TB
I don't see anything wrong with the html you show, other than the validation problems. html can't submit anything on its own so the problem must lie somewhere else.
Dec 4 '07 #8
Plater
7,872 Expert 4TB
I don't see anything wrong with the html you show, other than the validation problems. html can't submit anything on its own so the problem must lie somewhere else.
Yea, with IE (your favorite subject hehe)
FF doesn't do it, just IE and just with the content being long (haven't found the cutoff point for it)
I don't know it expected me to issuse multiple replies and segment it out, but it never sends any of the CONTINUE headers, and I reply back with Connection: Close in the header too.

I might just have to switch to xmlhttprequest for submition, it didn't have that problem.
Dec 4 '07 #9
Plater
7,872 Expert 4TB
Now it seems that if the content amount is long enough IE just goes to a blank white page and does nothing. If it's a little less content, it does the multiple post thing.

My latest solution:
Expand|Select|Wrap|Line Numbers
  1. <span class="Example">Internet Explorer users may experiance some flickering durring the save process</span>
  2.  
Dec 4 '07 #10
drhowarddrfine
7,435 Expert 4TB
See if anything here is related. Scroll down to " FORM and FORM-related Elements issues'
Dec 4 '07 #11
Plater
7,872 Expert 4TB
See if anything here is related. Scroll down to " FORM and FORM-related Elements issues'
Hmm, I *DO* have two input type="submit" buttons, but I am not seeing the behavior described were they both get sent (only the one clicked gets sent as part of the content).
I might remove one button and see if it still happens.

EDIT: Still happens with one button, only less frequently?
Dec 5 '07 #12
Death Slaught
1,137 1GB
Just out of curiousity, why not just use JavaScript for this?

Thanks, Death
Dec 5 '07 #13
Plater
7,872 Expert 4TB
You mean use XMLHttpRequest ? I have been using it for other pages, but I've built the content string manually.
If there's a good way to take a reference to a FORM and automate getting all of it's name=value pairs, I'm listening. I would prefer to not have to build the string by hand, using document.getelelementbyid for like 30values will stink enough, not to mention that I need to specify all the IDs manually too.
Dec 5 '07 #14
Death Slaught
1,137 1GB
I'm sure there is a way to do it without that much typing, of course I may be wrong. Ask in the JavaScript forum, if any one knows how to do it, it would be Acoder, and Gits.

Thanks, Death
Dec 5 '07 #15

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by chinagirl | last post: by
22 posts views Thread by Brett Romero | last post: by
6 posts views Thread by 0utlawza | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.