ie : form submits happening multiple times

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    ie : form submits happening multiple times

    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.
  • Death Slaught
    Top Contributor
    • Aug 2007
    • 1137

    #2
    I can't tell where or what your problem is without your code, so please post it.

    Thanks, Death

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      It's just a basic form?
      [code=html]
      <form method="post" name="nalarmsco nfig" id="alarmsconfi g">

      <input type="checkbox" name="nAlarmsEn abled" id="AlarmsEnabl ed" checked="checke d" />
      <textarea name="nEmailLis t" id="EmailList" cols="40" rows="8" >user@domain.co m</textarea><br />
      <select name="nAlarmsSt art" id="AlarmsStart ">
      <option value="0">12:00 AM</option>
      <option value="0">12:00 AM</option>
      <option value="60">1:00 AM</option>
      <option value="120">2:0 0 AM</option>
      <option value="180">3:0 0 AM</option>
      <option value="240">4:0 0 AM</option>
      <option value="300">5:0 0 AM</option>
      <option value="360">6:0 0 AM</option>
      <option value="420">7:0 0 AM</option>
      <option value="480">8:0 0 AM</option>
      <option value="540">9:0 0 AM</option>
      <option value="600">10: 00 AM</option>
      <option value="660">11: 00 AM</option>
      <option value="720">12: 00 PM</option>
      <option value="780">1:0 0 PM</option>
      <option value="840">2:0 0 PM</option>
      <option value="900">3:0 0 PM</option>
      <option value="960">4:0 0 PM</option>
      <option value="1020">5: 00 PM</option>
      <option value="1080">6: 00 PM</option>
      <option value="1140">7: 00 PM</option>
      <option value="1200">8: 00 PM</option>
      <option value="1260">9: 00 PM</option>
      <option value="1320">10 :00 PM</option>
      <option value="1380">11 :00 PM</option>
      </select><br />
      <select name="nAlarmsSt op" id="AlarmsStop" >
      <option value="1080">6: 00 PM</option>
      <option value="0">12:00 AM</option>
      <option value="60">1:00 AM</option>
      <option value="120">2:0 0 AM</option>
      <option value="180">3:0 0 AM</option>
      <option value="240">4:0 0 AM</option>
      <option value="300">5:0 0 AM</option>
      <option value="360">6:0 0 AM</option>
      <option value="420">7:0 0 AM</option>
      <option value="480">8:0 0 AM</option>
      <option value="540">9:0 0 AM</option>
      <option value="600">10: 00 AM</option>
      <option value="660">11: 00 AM</option>
      <option value="720">12: 00 PM</option>
      <option value="780">1:0 0 PM</option>
      <option value="840">2:0 0 PM</option>
      <option value="900">3:0 0 PM</option>
      <option value="960">4:0 0 PM</option>
      <option value="1020">5: 00 PM</option>
      <option value="1080">6: 00 PM</option>
      <option value="1140">7: 00 PM</option>
      <option value="1200">8: 00 PM</option>
      <option value="1260">9: 00 PM</option>
      <option value="1320">10 :00 PM</option>
      <option value="1380">11 :00 PM</option>
      </select><br />
      <input type="checkbox" name="nEnablePo werFailure" id="EnablePower Failure" checked="checke d" />
      <input type="checkbox" name="nEnableSa gSurge" id="EnableSagSu rge" checked="checke d" />
      <input type="text" name="nSagThres h" id="SagThresh" value="0"/>
      <input type="text" name="nSurgeThr esh" id="SurgeThresh " value="0"/>
      <input type="checkbox" name="nEnableNG Voltage" id="EnableNGVol tage" checked="checke d" />
      <input type="text" name="nNGMAX" id="NGMAX" value="0"/>
      <input type="checkbox" name="nEnableTr ansPeak" id="EnableTrans Peak" checked="checke d" />
      <input type="text" name="nTransSpl it" id="TransSplit " value="0"/>
      <input type="text" name="nTransSho rt" id="TransShort " value="0"/>
      <input type="text" name="nTransLon g" id="TransLong" value="0"/>


      <input type="checkbox" name="nEnableTe mp" id="EnableTemp " checked="checke d" />
      <input type="text" name="nMinTemp" id="MinTemp" value="0"/>
      <input type="text" name="nMaxTemp" id="MaxTemp" value="0"/>
      <input type="checkbox" name="nEnableHu midity" id="EnableHumid ity" onclick="DoChec k(this);" checked="checke d" />
      <input type="text" name="nMinHumid " id="MinHumid" value="0"/>
      <input type="text" name="nMaxHumid " id="MaxHumid" value="0"/>
      <input type="checkbox" name="nEnableAi rP" id="EnableAirP " onclick="DoChec k(this);" checked="checke d" />
      <input type="text" name="nMinAirP" id="MinAirP" value="0"/>
      <input type="text" name="nMaxAirP" id="MaxAirP" value="0"/>

      <input type="submit" name="nbtSave" id="btSave" value="Save" />
      <input type="submit" name="nbtTrigge r" id=btTrigger" value="Trigger/Test" />
      </form>
      [/code]

      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?

      Comment

      • Death Slaught
        Top Contributor
        • Aug 2007
        • 1137

        #4
        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="nameOfF ile.html"

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          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.

          Comment

          • Death Slaught
            Top Contributor
            • Aug 2007
            • 1137

            #6
            I don't know what to tell you. Have you tried validating it?

            - Death

            Comment

            • Plater
              Recognized Expert Expert
              • Apr 2007
              • 7872

              #7
              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

              Comment

              • drhowarddrfine
                Recognized Expert Expert
                • Sep 2006
                • 7434

                #8
                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.

                Comment

                • Plater
                  Recognized Expert Expert
                  • Apr 2007
                  • 7872

                  #9
                  Originally posted by drhowarddrfine
                  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.

                  Comment

                  • Plater
                    Recognized Expert Expert
                    • Apr 2007
                    • 7872

                    #10
                    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:
                    [code=html]
                    <span class="Example" >Internet Explorer users may experiance some flickering durring the save process</span>
                    [/code]

                    Comment

                    • drhowarddrfine
                      Recognized Expert Expert
                      • Sep 2006
                      • 7434

                      #11
                      See if anything here is related. Scroll down to " FORM and FORM-related Elements issues'

                      Comment

                      • Plater
                        Recognized Expert Expert
                        • Apr 2007
                        • 7872

                        #12
                        Originally posted by drhowarddrfine
                        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?

                        Comment

                        • Death Slaught
                          Top Contributor
                          • Aug 2007
                          • 1137

                          #13
                          Just out of curiousity, why not just use JavaScript for this?

                          Thanks, Death

                          Comment

                          • Plater
                            Recognized Expert Expert
                            • Apr 2007
                            • 7872

                            #14
                            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.getele lementbyid for like 30values will stink enough, not to mention that I need to specify all the IDs manually too.

                            Comment

                            • Death Slaught
                              Top Contributor
                              • Aug 2007
                              • 1137

                              #15
                              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

                              Comment

                              Working...