Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #30924

Re: Interesting form functionality difference

From Robert Baer <robertbaer@localnet.com>
Newsgroups comp.lang.javascript
Subject Re: Interesting form functionality difference
References <5aIhz.240$9n.232@fx38.iad> <87twfsr18i.fsf@bsb.me.uk> <2767618.5fSG56mABF@PointedEars.de> <NdDiz.2077$5_7.1800@fx20.iad> <2355525.mvXUDI8C0e@PointedEars.de>
Message-ID <b5Djz.7598$uD.7365@fx17.iad> (permalink)
Date 2016-07-19 20:27 -0800

Show all headers | View raw


Thomas 'PointedEars' Lahn wrote:
> Robert Baer wrote:
>
>>     I made the suggested change and the form data gets posted.
>
> Since you are not quoting what you are referring to, I do not know what you
> mean by “suggested change”.  Please read the FAQ on quoting.
>
>>     However, the form does not get cleared (ever).
>>     If online, the form in index-4.html does get cleared after a short
>> wait (which i assume is the transit time).
>
> The form is cleared if it is submitted classically, the server does not
> respond with status 204 “No Content”, and it does not respond with a filled-
> in form, in a time span so short that you cannot see the difference, either.
>
> It is also cleared if the script says it is to be cleared after its data is
> submitted non-classically, with XMLHttpRequest or (as Michael Haufe pointed
> out to me on Twitter), with the WHATWG Fetch API (currently experimental)
> [1], and there is no client-side script error before.
>
> Use debugging (again, see the FAQ) to find out what happens.
> “Does not work” is not a problem description.
>
> BTW, the English pronoun, “I”, is *always* written with a capital letter.
>
> _________
> [1]<https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API>
   Copy from page with form (which has 168 total lines):

       <form id="contact-form">
       <div class="success"> Contact form submitted!<br> <strong>We will 
be in touch soon.</strong></div>
       <fieldset>
        <label class="name">
         <input type="text" value="Name:">
         <span class="error">*This is not a valid name.</span>
         <span class="empty">*This field is required.</span>
         <span class="clear"></span>
        </label>
        <label class="email">
         <input type="text" value="E-mail:">
         <span class="error">*This is not a valid email address.</span>
         <span class="empty">*This field is required.</span>
         <span class="clear"></span>
        </label>
        <label class="phone">
         <input type="text" value="Phone:">
         <span class="error">*This is not a valid phone number.</span>
         <span class="empty">*This field is required.</span>
         <span class="clear"></span>
        </label>
        <label class="message">
         <textarea>Message:</textarea>
         <span class="error">*The message is too short.</span>
         <span class="empty">*This field is required.</span>
         <span class="clear"></span>
        </label>
        <div class="buttons"><span><a class="button" 
data-type="reset">Clear</a></span>
               <span><a class="button" 
data-type="submit">Submit</a></span></div>
       </fieldset>
      </form>

   Added--------------vvvvvvvvvvvvvvvvvvvvvvvvvvv
      mailHandlerURL:'http://www.oil4lessllc.com/bat/MailHandler.php',
   Above from local ..js/forms.js; note added URL is not present for the
online website.

   In both cases, online website, or using local hard drive copy, when
'Submit' button is clicked, the form data is sent.
   That added info was required to make it work from the local hard drive.

   BUT, like I said, the form is not cleared when working local. That is 
why I saw 2-4 copies of the data in our e-mail inbox; I had clicked the 
button exactly that many times.
   Also I do not care about that difference or why.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Interesting form functionality difference Robert Baer <robertbaer@localnet.com> - 2016-07-14 00:36 -0800
  Re: Interesting form functionality difference Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-14 10:57 +0100
    Re: Interesting form functionality difference Robert Baer <robertbaer@localnet.com> - 2016-07-14 17:40 -0800
      Re: Interesting form functionality difference Robert Baer <robertbaer@localnet.com> - 2016-07-14 18:03 -0800
    Re: Interesting form functionality difference Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-07-15 08:27 +0200
      Re: Interesting form functionality difference Robert Baer <robertbaer@localnet.com> - 2016-07-16 19:47 -0800
        Re: Interesting form functionality difference Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-07-17 20:31 +0200
          Re: Interesting form functionality difference Robert Baer <robertbaer@localnet.com> - 2016-07-19 20:27 -0800
            Re: Interesting form functionality difference Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-07-24 18:40 +0200

csiph-web