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


Groups > comp.lang.javascript > #30969

Re: Interesting form functionality difference

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Interesting form functionality difference
Date 2016-07-24 18:40 +0200
Organization PointedEars Software (PES)
Message-ID <1689658.PYKUYFuaPT@PointedEars.de> (permalink)
References (1 earlier) <87twfsr18i.fsf@bsb.me.uk> <2767618.5fSG56mABF@PointedEars.de> <NdDiz.2077$5_7.1800@fx20.iad> <2355525.mvXUDI8C0e@PointedEars.de> <b5Djz.7598$uD.7365@fx17.iad>

Show all headers | View raw


Robert Baer wrote:

>    Copy from page with form (which has 168 total lines):
> 
>        <form id="contact-form">
>        […]
>         <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.

As posted, it is not a submit button, which is why this does not work 
without client-side scripting.  Bad idea.

However, the document tree can look different than the original markup.
See e.g. the “Elements” tab in Chrome Dev Tools for the former.

>    That added info was required to make it work from the local hard drive.

Then it is probably adding an “action” attribute to the form and calls the 
form’s submit() method.  Because there is no indication that this site 
supports CORS, and without CORS you cannot do XHR across origins.  (A cross- 
origin GET request without that would still be possible e.g. as JSONP, but 
that is not recommended here because of the browser’s URI length limit.)
 
>    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.

Why should I care about your problems then?

And will you *please* trim your quotes to the *relevant* parts?

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | NextPrevious 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