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


Groups > comp.lang.javascript > #30843 > unrolled thread

How fetch data from form for javascript screening

Started byRobert Baer <robertbaer@localnet.com>
First post2016-07-11 22:41 -0800
Last post2016-07-15 11:32 +0200
Articles 18 — 4 participants

Back to article view | Back to comp.lang.javascript


Contents

  How fetch data from form for javascript screening Robert Baer <robertbaer@localnet.com> - 2016-07-11 22:41 -0800
    Re: How fetch data from form for javascript screening Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-07-12 11:38 +0200
      Re: How fetch data from form for javascript screening "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-12 11:50 +0200
        Re: How fetch data from form for javascript screening Robert Baer <robertbaer@localnet.com> - 2016-07-12 13:50 -0800
          Re: How fetch data from form for javascript screening "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-13 00:09 +0200
            Re: How fetch data from form for javascript screening Robert Baer <robertbaer@localnet.com> - 2016-07-12 17:27 -0800
          Re: How fetch data from form for javascript screening Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-07-13 01:15 +0200
            Re: How fetch data from form for javascript screening Robert Baer <robertbaer@localnet.com> - 2016-07-12 18:53 -0800
              Re: How fetch data from form for javascript screening Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-07-13 18:03 +0200
                Re: How fetch data from form for javascript screening Robert Baer <robertbaer@localnet.com> - 2016-07-14 00:16 -0800
                  Re: How fetch data from form for javascript screening Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-07-14 23:40 +0200
      Re: How fetch data from form for javascript screening Robert Baer <robertbaer@localnet.com> - 2016-07-12 13:40 -0800
        Re: How fetch data from form for javascript screening Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-07-13 01:09 +0200
          Re: How fetch data from form for javascript screening Robert Baer <robertbaer@localnet.com> - 2016-07-12 17:51 -0800
            Re: How fetch data from form for javascript screening Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-07-14 01:07 +0200
    Re: How fetch data from form for javascript screening "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-07-13 14:30 +0200
      Re: How fetch data from form for javascript screening Robert Baer <robertbaer@localnet.com> - 2016-07-13 23:56 -0800
        Re: How fetch data from form for javascript screening Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-07-15 11:32 +0200

#30843 — How fetch data from form for javascript screening

FromRobert Baer <robertbaer@localnet.com>
Date2016-07-11 22:41 -0800
SubjectHow fetch data from form for javascript screening
Message-ID<ti0hz.37337$Z95.7322@fx29.iad>
   What i have..(comments 'mobile' and '686' are correct)..help?

<script type="text/javascript">
// ** Screening code to use follows

   document.writeln("First check addressing.. ");

   var subjptr=7;

   tstE= EBody[subjptr];
   document.writeln("EBody[7]="+tstE+", ");   //  mobile

   gott= Email.indexOf(tstE);
   document.writeln("Email.indexOf('mobile')="+gott+"<BR><BR>");   //  686

// ** Note: The getElementsByClassName() method is not supported in
//  Internet Explorer 8 and earlier versions.

</SCRIPT>


  <form name="dataholder" action="">
    <div class="form-group">
      <label>Your Name <span style="color:#F00">*</span></label>
      <input type="text" class="form-control" name="QN" id="#" >
      <!-- input type="text" size=57  name="QN" value="" -->
    </div>

    <div class="form-group">
      <label>Email <span style="color:#F00">*</span></label>
      <!-- The browser must use the tpe for crude checkfor te @ sign -->
      <input type="email" class="form-control" name="QE" id="#" >
    </div>

    <div class="form-group">
      <label>Subject </label>
      <input type="text" class="form-control" name="QS" id="#" >
    </div>

    <div class="form-group">
      <label>Your Message </label>
      <textarea class="form-control" rows="3"></textarea>
    </div>
    <button style="margin-bottom:10px;" type="submit" class="btn 
btn-default">SUBMIT</button>
  </form>
  </div>


<script type="text/javascript">

// do not know what to do to get those variables

     document.writeln("Plain document.writeln works.<BR>");
     document.writeln("Data holder scheme does not work.<BR>");

     Qnam=document.dataholder.QN.value;
     document.writeln("From dataholder:"+Qnam+"<BR>");

     document.writeln("getElementById via value does not work and 
crashes.<BR>");
//    Qnam=document.getElementById("QN").value;
//    document.writeln("From value:"+Qnam+"<BR>");

     document.writeln("getElementById via name does not work and 
crashes.<BR>");
//    Cnam=document.getElementById("QN").name;
//    document.writeln("From name:"+Cnam+"<BR>");

     document.writeln("getElementById via innerHTML does not work and 
crashes.<BR>");
//    Qmai=document.getElementById("QE").innerHTML;
//    document.writeln(Qmai+"|<BR>");


//  following gives undefined
//    Qmsg=document.getElementsByName("form-control").innerHTML ;
//    document.writeln(Qmsg+"|<BR>");

</SCRIPT>

[toc] | [next] | [standalone]


#30844

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2016-07-12 11:38 +0200
Message-ID<7944450.CDJkKcVGEf@PointedEars.de>
In reply to#30843
Robert Baer wrote:

>    What i have..(comments 'mobile' and '686' are correct)..help?

<http://catb.org/esr/faqs/smart-questions.html>

> <script type="text/javascript">
> // ** Screening code to use follows

“Screening”?

>    document.writeln("First check addressing.. ");
> 
>    var subjptr=7;
> 
>    tstE= EBody[subjptr];

1. Assignment to undeclared identifier.

2. “EBody” should probably be “eBody”.

>    document.writeln("EBody[7]="+tstE+", ");   //  mobile

  document.writeln("EBody[" + subjptr + "]=" + tstE + ", ");   //  mobile
 
would be wiser.  However, see the FAQ on debugging.

>    gott= Email.indexOf(tstE);

Assignment to undeclared identifier.

>    document.writeln("Email.indexOf('mobile')="+gott+"<BR><BR>");   //  686
> 
> // ** Note: The getElementsByClassName() method is not supported in
> //  Internet Explorer 8 and earlier versions.
> 
> </SCRIPT>
> 
> 
>   <form name="dataholder" action="">

How can the user submit that form without script support?

>     <div class="form-group">
>       <label>Your Name <span style="color:#F00">*</span></label>

Use stylesheet rules, avoid style attributes.

>       <input type="text" class="form-control" name="QN" id="#" >

Invalid ID except in HTML5.  <http://validator.w3.org/>

> […]
>       <!-- The browser must use the tpe for crude checkfor te @ sign -->

I beg your pardon?

>       <input type="email" class="form-control" name="QE" id="#" >

Invalid, duplicate ID.

> […]
>       <input type="text" class="form-control" name="QS" id="#" >

Invalid, duplicate ID.

> <script type="text/javascript">
> 
> // do not know what to do to get those variables

That is not a question.

> //  following gives undefined
> //    Qmsg=document.getElementsByName("form-control").innerHTML ;
> //    document.writeln(Qmsg+"|<BR>");

getElement*s*ByName
 
-- 
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.

[toc] | [prev] | [next] | [standalone]


#30845

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2016-07-12 11:50 +0200
Message-ID<XnsA64378799AF81eejj99@194.109.6.166>
In reply to#30844
Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote on 12 Jul 2016 in 
comp.lang.javascript:

>>       <input type="text" class="form-control" name="QN" id="#" >
[..]
>>       <input type="text" class="form-control" name="QS" id="#" >
[..]
>> //  following gives undefined
>> //    Qmsg=document.getElementsByName("form-control").innerHTML ;
>> //    document.writeln(Qmsg+"|<BR>");
> 
> getElement*s*ByName

document.document.getElementsByClassName("form-control")[0].innerHTML


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#30848

FromRobert Baer <robertbaer@localnet.com>
Date2016-07-12 13:50 -0800
Message-ID<FCdhz.1$pP1.0@fx27.iad>
In reply to#30845
Evertjan. wrote:
> Thomas 'PointedEars' Lahn<PointedEars@web.de>  wrote on 12 Jul 2016 in
> comp.lang.javascript:
>
>>>        <input type="text" class="form-control" name="QN" id="#">
> [..]
>>>        <input type="text" class="form-control" name="QS" id="#">
> [..]
>>> //  following gives undefined
>>> //    Qmsg=document.getElementsByName("form-control").innerHTML ;
>>> //    document.writeln(Qmsg+"|<BR>");
>>
>> getElement*s*ByName
>
> document.document.getElementsByClassName("form-control")[0].innerHTML
>
>
   Cannot use.; the getElementsByClassName() method is not supported in 
Internet Explorer 8 and earlier versions.

  Now, getElementByClassName() is not even mentioned as being valid, and 
so there is even less info if wonderful M$ HEXploder would work.

   I could just as easily make up something: fetchStuffByAnyNameOrId(); 
the only advantage would be that i would KNOW it would not work.

[toc] | [prev] | [next] | [standalone]


#30849

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2016-07-13 00:09 +0200
Message-ID<XnsA6441954FBECeejj99@194.109.6.166>
In reply to#30848
Robert Baer <robertbaer@localnet.com> wrote on 12 Jul 2016 in 
comp.lang.javascript:

> Cannot use.; the getElementsByClassName() method is not supported in 
> Internet Explorer 8 and earlier versions.

If so, why would you want to accomodate for that?

Then perhaps not use Javascript at all
as there surely must also be someone that has switched it off.

If you use only text and hyperlinks, you can add Lynx for Unix.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#30852

FromRobert Baer <robertbaer@localnet.com>
Date2016-07-12 17:27 -0800
Message-ID<yOghz.3$1b.2@fx26.iad>
In reply to#30849
Evertjan. wrote:
> Robert Baer<robertbaer@localnet.com>  wrote on 12 Jul 2016 in
> comp.lang.javascript:
>
>> Cannot use.; the getElementsByClassName() method is not supported in
>> Internet Explorer 8 and earlier versions.
>
> If so, why would you want to accomodate for that?
* Because there are a goodly percentage that use IE8 (unrelated, but 
also support IE7, IE9, IE10 and IE11).

>
> Then perhaps not use Javascript at all
> as there surely must also be someone that has switched it off.
* Have understanding that "all" browsers support javacript out of the 
box, so to speak. The only reason i can think of to "switch off" 
javascript, would be that they got tired of seeing trails of ants as 
they move the cursor. (i had that for a while...)

>
> If you use only text and hyperlinks, you can add Lynx for Unix.
* Looked it up; see it is a browser for Unix.
   First, the site as pictures and second, why chase <0.01% of users?

>

[toc] | [prev] | [next] | [standalone]


#30851

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2016-07-13 01:15 +0200
Message-ID<19082016.EfDdHjke4D@PointedEars.de>
In reply to#30848
Robert Baer wrote:

> Evertjan. wrote:
>>>>        <input type="text" class="form-control" name="QN" id="#">
>> [..]
>>>>        <input type="text" class="form-control" name="QS" id="#">
>> [..]
>>>> //  following gives undefined
>>>> //    Qmsg=document.getElementsByName("form-control").innerHTML ;
>>>> //    document.writeln(Qmsg+"|<BR>");
>>> […]
>> document.document.getElementsByClassName("form-control")[0].innerHTML
>    Cannot use.; the getElementsByClassName() method is not supported in
> Internet Explorer 8 and earlier versions.

Do you need to support IE <= 8?

>   Now, getElementByClassName() is not even mentioned as being valid,

Where?  By whom/what?

>   and so there is even less info if wonderful M$ HEXploder would work.

Responsible Web developers *test* their code in the target environments.

>    I could just as easily make up something: fetchStuffByAnyNameOrId();
> the only advantage would be that i would KNOW it would not work.

You are wasting precious time.  Have you read “How To Ask Questions The 
Smart Way”?  If no, read it, and act accordingly.  NOW.

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

[toc] | [prev] | [next] | [standalone]


#30854

FromRobert Baer <robertbaer@localnet.com>
Date2016-07-12 18:53 -0800
Message-ID<R2ihz.1$cN5.0@fx28.iad>
In reply to#30851
Thomas 'PointedEars' Lahn wrote:
> Robert Baer wrote:
>
>> Evertjan. wrote:
>>>>>         <input type="text" class="form-control" name="QN" id="#">
>>> [..]
>>>>>         <input type="text" class="form-control" name="QS" id="#">
>>> [..]
>>>>> //  following gives undefined
>>>>> //    Qmsg=document.getElementsByName("form-control").innerHTML ;
>>>>> //    document.writeln(Qmsg+"|<BR>");
>>>> […]
>>> document.document.getElementsByClassName("form-control")[0].innerHTML
>>     Cannot use.; the getElementsByClassName() method is not supported in
>> Internet Explorer 8 and earlier versions.
>
> Do you need to support IE<= 8?
* IE7 would be nice,but it looks like i can safely ignore it, especially 
if it gives too many problems.
* except for implementing form validation code for the form, it appears 
that all of my new HTML5 pages behave from IE6 all the way up.
  Strangely, IE9 gave the most sass.
  Would you believe IE5 was almost better?

>
>>    Now, getElementByClassName() is not even mentioned as being valid,
>
> Where?  By whom/what?
>
>>    and so there is even less info if wonderful M$ HEXploder would work.
>
> Responsible Web developers *test* their code in the target environments.
>
>>     I could just as easily make up something: fetchStuffByAnyNameOrId();
>> the only advantage would be that i would KNOW it would not work.
>
> You are wasting precious time.  Have you read “How To Ask Questions The
> Smart Way”?  If no, read it, and act accordingly.  NOW.
* OK; WHERE can i find that?
   Sorry, i ASSuMEd that info was on this forum and/or server.
   Google, etc came to the rescue.
   Hours of reading, may not need to buy a book again..


>
   Thanks.

[toc] | [prev] | [next] | [standalone]


#30856

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2016-07-13 18:03 +0200
Message-ID<6567809.EvYhyI6sBW@PointedEars.de>
In reply to#30854
Robert Baer wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Robert Baer wrote:
>>> Evertjan. wrote:
>>>> document.document.getElementsByClassName("form-control")[0].innerHTML
>>>     Cannot use.; the getElementsByClassName() method is not supported in
>>> Internet Explorer 8 and earlier versions.
>>
>> Do you need to support IE<= 8?
> * IE7 would be nice,but it looks like i can safely ignore it, especially
> if it gives too many problems.

If you have no explicit requirement to support IE 8, you can ignore it now, 
too:

<https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE-support>

<https://support.microsoft.com/en-us/lifecycle#gp/Microsoft-Internet-Explorer> shows that you only need to support IE 8 if you need to support

- Windows Embedded Standard 2009 (WES09),
- Windows Embedded POSReady 2009, or
- Windows Thin PC

as users can and are recommended to upgrade to IE 9 or later on other 
versions of Windows.

Caveat: Your site or Web application must not run in Document Compatibility 
Mode of IE 9 or later as that is equivalent to running in IE 8 or earlier.  
The appropriate “meta” elements should be included to prevent that from 
happening (hiding the Compatibility Mode button in the Location Bar). 

> * except for implementing form validation code for the form, it appears
> that all of my new HTML5 pages behave from IE6 all the way up.

IE 8 also does not support HTML5 out of the box.

>   Strangely, IE9 gave the most sass.
>   Would you believe IE5 was almost better?

I beg your pardon?

>>>     I could just as easily make up something: fetchStuffByAnyNameOrId();
>>> the only advantage would be that i would KNOW it would not work.
>>
>> You are wasting precious time.  Have you read “How To Ask Questions The
>> Smart Way”?  If no, read it, and act accordingly.  NOW.
> * OK; WHERE can i find that?

(Why these asterisks?)

You can find its URI on top of my first follow-up to your first posting in 
this thread.

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

[toc] | [prev] | [next] | [standalone]


#30861

FromRobert Baer <robertbaer@localnet.com>
Date2016-07-14 00:16 -0800
Message-ID<QTHhz.317$E07.32@fx07.iad>
In reply to#30856
Thomas 'PointedEars' Lahn wrote:
> Robert Baer wrote:
>
>> Thomas 'PointedEars' Lahn wrote:
>>> Robert Baer wrote:
>>>> Evertjan. wrote:
>>>>> document.document.getElementsByClassName("form-control")[0].innerHTML
>>>>      Cannot use.; the getElementsByClassName() method is not supported in
>>>> Internet Explorer 8 and earlier versions.
>>>
>>> Do you need to support IE<= 8?
>> * IE7 would be nice,but it looks like i can safely ignore it, especially
>> if it gives too many problems.
>
> If you have no explicit requirement to support IE 8, you can ignore it now,
> too:
>
> <https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE-support>
>
> <https://support.microsoft.com/en-us/lifecycle#gp/Microsoft-Internet-Explorer>  shows that you only need to support IE 8 if you need to support
>
> - Windows Embedded Standard 2009 (WES09),
> - Windows Embedded POSReady 2009, or
> - Windows Thin PC
>
> as users can and are recommended to upgrade to IE 9 or later on other
> versions of Windows.
>
> Caveat: Your site or Web application must not run in Document Compatibility
> Mode of IE 9 or later as that is equivalent to running in IE 8 or earlier.
> The appropriate “meta” elements should be included to prevent that from
> happening (hiding the Compatibility Mode button in the Location Bar).
>
>> * except for implementing form validation code for the form, it appears
>> that all of my new HTML5 pages behave from IE6 all the way up.
>
> IE 8 also does not support HTML5 out of the box.
>
>>    Strangely, IE9 gave the most sass.
>>    Would you believe IE5 was almost better?
>
> I beg your pardon?
>
>>>>      I could just as easily make up something: fetchStuffByAnyNameOrId();
>>>> the only advantage would be that i would KNOW it would not work.
>>>
>>> You are wasting precious time.  Have you read “How To Ask Questions The
>>> Smart Way”?  If no, read it, and act accordingly.  NOW.
>> * OK; WHERE can i find that?
>
> (Why these asterisks?)
>
> You can find its URI on top of my first follow-up to your first posting in
> this thread.
>
   You are correct regarding the "older" versions of IE, however there 
are always a number of users that do not (in effect) get the message, or 
for arcane reasons ignore the mad update cycle.

   IE5 was being used by a number of people, mostly (i think) they "did 
not know better"; very little "dancing: was needed to accommodate what 
otherwise would be sliders - likewise fixed width screens, up-to 800x600 
and NOT get black background to the right and have a horizontal scroll bar.

   All in the dim and dark past now; that was maybe 10+ years ago.

   Thanks.
   PS: the asterisks was my way of showing my inserted comments.

[toc] | [prev] | [next] | [standalone]


#30865

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2016-07-14 23:40 +0200
Message-ID<7950342.CDJkKcVGEf@PointedEars.de>
In reply to#30861
Robert Baer wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Robert Baer wrote:
>>> Thomas 'PointedEars' Lahn wrote:
>>>> Robert Baer wrote:
>>>>>      I could just as easily make up something:
>>>>>      fetchStuffByAnyNameOrId();
>>>>> the only advantage would be that i would KNOW it would not work.
>>>>
>>>> You are wasting precious time.  Have you read “How To Ask Questions The
>>>> Smart Way”?  If no, read it, and act accordingly.  NOW.
>>> * OK; WHERE can i find that?
>>
>> (Why these asterisks?)
>>
>> You can find its URI on top of my first follow-up to your first posting
>> in this thread.
>>
>    You are correct regarding the "older" versions of IE, however there
> are always a number of users that do not (in effect) get the message, or
> for arcane reasons ignore the mad update cycle.

If there are, one should not support them becoming a target for attackers, 
and unknowingly spreading malware through their unsafe software.  It is one 
thing to be backwards compatible, to support a broad community of users; it 
is another to hinder technological progress and putting people into danger 
while doing that.  Terminated support for a software version at the vendor 
also means no more security updates for that software.  Besides, today’s Web 
experience with those browser versions is already quite bad.

As for the number of users, for last month and this one IE 8.0 market share 
has dropped to 1.04 % worldwide.  It is 0.98 % in the USA, 1.18 % in the 
Russian Federation, and 6.55 % in the People’s Republic of China.  The trend 
for this month is downwards: 1.01 % worldwide, 0.89 % in the USA, 1.08 % in 
Russia, and 6.31 % in China.

<http://gs.statcounter.com/#browser_version_partially_combined-ww-monthly-201606-201607-bar>

>    PS: the asterisks was my way of showing my inserted comments.

That was unnecessary since everything quoted from the thread is (to be) 
preceded by “> ”.

As for quotations, please trim yours to the parts that you are referring to.  
The text cursor is/should be positioned above the quotation so that you can 
work your way down and remove the parts (while marking omissions if 
necessary) that you think are irrelevant to your follow-up.

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

[toc] | [prev] | [next] | [standalone]


#30847

FromRobert Baer <robertbaer@localnet.com>
Date2016-07-12 13:40 -0800
Message-ID<Itdhz.1$uD.0@fx17.iad>
In reply to#30844
Thomas 'PointedEars' Lahn wrote:
> Robert Baer wrote:
>
>>     What i have..(comments 'mobile' and '686' are correct)..help?
>
> <http://catb.org/esr/faqs/smart-questions.html>
>
>> <script type="text/javascript">
>> // ** Screening code to use follows
>
> “Screening”?
* Yes; ASSuME i can get the data entered in the form fields, i want to 
test according to certain criteria and REJECT the "e-mail" attempt.

>
>>     document.writeln("First check addressing.. ");
>>
>>     var subjptr=7;
>>
>>     tstE= EBody[subjptr];
>
> 1. Assignment to undeclared identifier.
>
> 2. “EBody” should probably be “eBody”.
* Well,the assignment does that. I used the name EBody  for the array; 
could have mixed the character cases at randumb for all javascript cares.

>
>>     document.writeln("EBody[7]="+tstE+", ");   //  mobile
>
>    document.writeln("EBody[" + subjptr + "]=" + tstE + ", ");   //  mobile
>
> would be wiser.  However, see the FAQ on debugging.
* Point taken; thanks.

>
>>     gott= Email.indexOf(tstE);
>
> Assignment to undeclared identifier.
* Been thru that already (above).

>
>>     document.writeln("Email.indexOf('mobile')="+gott+"<BR><BR>");   //  686
>>
>> // ** Note: The getElementsByClassName() method is not supported in
>> //  Internet Explorer 8 and earlier versions.
>>
>> </SCRIPT>
>>
>>
>>    <form name="dataholder" action="">
>
> How can the user submit that form without script support?
* I know absolutely NOTHING how forms work.
* for an input form that DOES work without script support, see 
http://www.oil4lessllc.com/index-4.html.

>
>>      <div class="form-group">
>>        <label>Your Name<span style="color:#F00">*</span></label>
>
> Use stylesheet rules, avoid style attributes.
* I know less about style sheets than a fly.

>
>>        <input type="text" class="form-control" name="QN" id="#">
>
> Invalid ID except in HTML5.<http://validator.w3.org/>
* Stolen coding that i am fiddling with in futile attempts to get info 
from form to javascript.

>
>> […]
>>        <!-- The browser must use the tpe for crude checkfor te @ sign -->
>
> I beg your pardon?
   Note: input type="email"; the browser must be doing the checking for 
an "@" sign - input must be like x@x and not xxx.

>
>>        <input type="email" class="form-control" name="QE" id="#">
>
> Invalid, duplicate ID.
* Again,stolen code. Removing the id= totally makes zero difference.

>
>> […]
>>        <input type="text" class="form-control" name="QS" id="#">
>
> Invalid, duplicate ID.
*  Moo; herd you first time.

>
>> <script type="text/javascript">
>>
>> // do not know what to do to get those variables
>
> That is not a question.
* OK, it was a statement. _HOW_ do i get this to work?
   Code stolen from http://www.oil4lessllc.com/index-4.html.

>
>> //  following gives undefined
>> //    Qmsg=document.getElementsByName("form-control").innerHTML ;
>> //    document.writeln(Qmsg+"|<BR>");
>
> getElement*s*ByName
* Yes; online guides indicated a message field/block is an array; that 
reading from a multi-line field/block is done by a set (array) of elements.
   I could change that, but the change will not fix the rest of the 
problems.

>
   How can i transfer the data?

   Thanks.

[toc] | [prev] | [next] | [standalone]


#30850

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2016-07-13 01:09 +0200
Message-ID<1692390.PYKUYFuaPT@PointedEars.de>
In reply to#30847
Robert Baer wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Robert Baer wrote:
>>> <script type="text/javascript">
>>> // ** Screening code to use follows
>>
>> “Screening”?
> * Yes; ASSuME i can get the data entered in the form fields,

In theory, you can.

> i want to test according to certain criteria and REJECT the "e-mail" 
> attempt.

The proper term for that is “form validation”.

>>>     tstE= EBody[subjptr];
>>
>> 1. Assignment to undeclared identifier.
>>
>> 2. “EBody” should probably be “eBody”.
> * Well,the assignment does that.

Does what?  You have to declare the identifier one of a variable or this is 
at least error-prone.  (In the recommended strict mode, it throws a 
ReferenceError exception.)

> I used the name EBody  for the array;
> could have mixed the character cases at randumb for all javascript cares.

Only identifiers for constructors/classes and constant(-like value)s should 
start with a capital character (constructor’s/class’s identifiers should be 
camel-case, constant’s identifiers should be all-uppercase), to tell them 
apart.

>>>    <form name="dataholder" action="">
>>
>> How can the user submit that form without script support?
> * I know absolutely NOTHING how forms work.

Learn it.

> * for an input form that DOES work without script support, see […]

You do realize that it was a rhetoric question, yes?

>> Use stylesheet rules, avoid style attributes.
> * I know less about style sheets than a fly.

Learn it.

>>>        <input type="text" class="form-control" name="QN" id="#">
>>
>> Invalid ID except in HTML5.<http://validator.w3.org/>
> * Stolen coding that i am fiddling with in futile attempts to get info
> from form to javascript.

This is not a free support forum for script-kiddies doing copy & pray, but a 
newsgroup for (aspiring) software developers.

>>> […]
>>>        <!-- The browser must use the tpe for crude checkfor te @ sign
>>>        -->
>>
>> I beg your pardon?
>    Note: input type="email"; the browser must be doing the checking for
> an "@" sign - input must be like x@x and not xxx.

The rules are considerably more complex than that, and you may want to use 
your own validator instead since the built-in rules are too restrictive (and 
work only in HTML5 user agents anyway).

>>> <script type="text/javascript">
>>>
>>> // do not know what to do to get those variables
>>
>> That is not a question.
> * OK, it was a statement. _HOW_ do i get this to work?
>    Code stolen from http://www.oil4lessllc.com/index-4.html.

See above.  You need a minimum clue before it makes sense to give you 
further advice.  But this is not JavaScript/DOM 101; you need to *follow* 
the *references* to *free* documentation that you have been given, and 
*read* about the basics there.

>>> //  following gives undefined
>>> //    Qmsg=document.getElementsByName("form-control").innerHTML ;
>>> //    document.writeln(Qmsg+"|<BR>");
>>
>> getElement*s*ByName
> * Yes; online guides indicated a message field/block is an array;

It is not; instead, the getElement*s*ByName() method returns a reference to 
an array-like DOM object (that implements at least the NodeList interface).  
Compare getElementById().

> that reading from a multi-line field/block is done by a set (array) of
> elements.

This has nothing to do with whether the field is multi-line (i.e. is a 
textarea).  What “block” are you talking about?

>    I could change that,

You cannot, this feature is built into the DOM implementation.

>    but the change will not fix the rest of the
> problems.

The main problem is that you do not have the slightest clue what you are 
doing or talking about, and you appear to be unwilling to make an effort 
changing that.

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

[toc] | [prev] | [next] | [standalone]


#30853

FromRobert Baer <robertbaer@localnet.com>
Date2016-07-12 17:51 -0800
Message-ID<P8hhz.310$WL3.241@fx33.iad>
In reply to#30850
Thomas 'PointedEars' Lahn wrote:
> Robert Baer wrote:
>
>> Thomas 'PointedEars' Lahn wrote:
>>> Robert Baer wrote:
>>>> <script type="text/javascript">
>>>> // ** Screening code to use follows
>>>
>>> “Screening”?
>> * Yes; ASSuME i can get the data entered in the form fields,
>
> In theory, you can.
* Yah; the rub is in the practice...

>
>> i want to test according to certain criteria and REJECT the "e-mail"
>> attempt.
>
> The proper term for that is “form validation”.
* Thanks; documentaton duly changed.

>
>>>>      tstE= EBody[subjptr];
>>>
>>> 1. Assignment to undeclared identifier.
>>>
>>> 2. “EBody” should probably be “eBody”.
>> * Well,the assignment does that.
>
> Does what?
* The assignment declares the identifier.

> You have to declare the identifier one of a variable or this is
> at least error-prone.  (In the recommended strict mode, it throws a
> ReferenceError exception.)
* Have changed them to read: var tstE= EBody[subjptr];

>
>> I used the name EBody  for the array;
>> could have mixed the character cases at randumb for all javascript cares.
>
> Only identifiers for constructors/classes and constant(-like value)s should
> start with a capital character (constructor’s/class’s identifiers should be
> camel-case, constant’s identifiers should be all-uppercase), to tell them
> apart.
* do not know about constructors, but have changed all EBody to eBody.

>
>>>>     <form name="dataholder" action="">
>>>
>>> How can the user submit that form without script support?
>> * I know absolutely NOTHING how forms work.
>
> Learn it.
>
>> * for an input form that DOES work without script support, see […]
>
> You do realize that it was a rhetoric question, yes
* no.

>
>>> Use stylesheet rules, avoid style attributes.
>> * I know less about style sheets than a fly.
>
> Learn it.
>
>>>>         <input type="text" class="form-control" name="QN" id="#">
>>>
>>> Invalid ID except in HTML5.<http://validator.w3.org/>
>> * Stolen coding that i am fiddling with in futile attempts to get info
>> from form to javascript.
>
> This is not a free support forum for script-kiddies doing copy&  pray, but a
> newsgroup for (aspiring) software developers.
>
>>>> […]
>>>>         <!-- The browser must use the tpe for crude checkfor te @ sign
>>>>         -->
>>>
>>> I beg your pardon?
>>     Note: input type="email"; the browser must be doing the checking for
>> an "@" sign - input must be like x@x and not xxx.
>
> The rules are considerably more complex than that, and you may want to use
> your own validator instead since the built-in rules are too restrictive (and
> work only in HTML5 user agents anyway).
* 1) The code i am building on is all HTML5.
   2) i plan to add more restrictive rules as checking for an "@" only 
is rather lame.
   3) if that has more rules, nobody is talking.

>
>>>> <script type="text/javascript">
>>>>
>>>> // do not know what to do to get those variables
>>>
>>> That is not a question.
>> * OK, it was a statement. _HOW_ do i get this to work?
>>     Code stolen from http://www.oil4lessllc.com/index-4.html.
>
> See above.  You need a minimum clue before it makes sense to give you
> further advice.  But this is not JavaScript/DOM 101; you need to *follow*
> the *references* to *free* documentation that you have been given, and
> *read* about the basics there.
* I tried SIX other schemes from "references" as read in "free" 
documentation, and NONE work.
   None of those said anything about "basics".

>
>>>> //  following gives undefined
>>>> //    Qmsg=document.getElementsByName("form-control").innerHTML ;
>>>> //    document.writeln(Qmsg+"|<BR>");
>>>
>>> getElement*s*ByName
>> * Yes; online guides indicated a message field/block is an array;
>
> It is not; instead, the getElement*s*ByName() method returns a reference to
> an array-like DOM object (that implements at least the NodeList interface).
> Compare getElementById().
>
>> that reading from a multi-line field/block is done by a set (array) of
>> elements.
>
> This has nothing to do with whether the field is multi-line (i.e. is a
> textarea).  What “block” are you talking about?
* The box i see; a block of character space.

>
>>     I could change that,
>
> You cannot, this feature is built into the DOM implementation.
>
>>     but the change will not fix the rest of the
>> problems.
>
> The main problem is that you do not have the slightest clue what you are
> doing or talking about, and you appear to be unwilling to make an effort
> changing that.
* Effort? Spending many hours,working with "examples" of code said to work?
   Even tho the result is zilch, the effort is a lot.
   Got frustrated and asked for help.

>
   Thanks.

[toc] | [prev] | [next] | [standalone]


#30857

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2016-07-14 01:07 +0200
Message-ID<3058916.iIbC2pHGDl@PointedEars.de>
In reply to#30853
Robert Baer wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Robert Baer wrote:
>>> Thomas 'PointedEars' Lahn wrote:
>>>> Robert Baer wrote:
>>>>>      tstE= EBody[subjptr];
>>>> 1. Assignment to undeclared identifier.
>>>> […]
>>> * Well,the assignment does that.
>>
>> Does what?
> * The assignment declares the identifier.

No, it does not.  How did you get that idea?

>>>     Note: input type="email"; the browser must be doing the checking for
>>> an "@" sign - input must be like x@x and not xxx.
>>
>> The rules are considerably more complex than that, and you may want to
>> use your own validator instead since the built-in rules are too
>> restrictive (and work only in HTML5 user agents anyway).
> * 1) The code i am building on is all HTML5.

That does not mean that HTML5 features are supported by the used Web 
browser.  I remember vividly that someone in this thread wanted to support 
IE down to version 6…

>    2) i plan to add more restrictive rules as checking for an "@" only
> is rather lame.

If you use the built-in validation, you will have more than a check for “@” 
(in HTML5-capable user agents).  But AISB, it might be too restrictive for 
your use case.  RTFSpec.

>    3) if that has more rules, nobody is talking.

What do you mean by that?

> * I tried SIX other schemes from "references" as read in "free"
> documentation, and NONE work.

Only because you have used them in the wrong way.

>    None of those said anything about "basics".

You must be kidding.

>>> that reading from a multi-line field/block is done by a set (array) of
>>> elements.
>>
>> This has nothing to do with whether the field is multi-line (i.e. is a
>> textarea).  What “block” are you talking about?
> * The box i see; a block of character space.

That *is* a _textarea_, generated by the “textarea” element in your markup.  
(Again, *HTML* basics.  You *really* need to *learn* HTML before you can use 
client-side scripting on HTML documents.  We all had to do that and have 
done it.  Trust me, there is no viable shortcut.)

>>>     but the change will not fix the rest of the
>>> problems.
>>
>> The main problem is that you do not have the slightest clue what you are
>> doing or talking about, and you appear to be unwilling to make an effort
>> changing that.
> 
> * Effort? Spending many hours,working with "examples" of code said to
> work?
>    Even tho the result is zilch, the effort is a lot.
>    Got frustrated and asked for help.

Well, you have copypasted something and ran that, but you are just reporting 
the problems with what you copypasted; you are still not making a *sincere* 
effort in *understanding* what you are doing, and so you are not assisting 
us in helping you.  You appear to be waiting for a complete solution falling 
out of the sky instead, and that is not going to happen – not least because 
all our crystal balls are currently on vacation.

Your postings are hard to read.  Please read the FAQ on posting, too.

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

[toc] | [prev] | [next] | [standalone]


#30855

From"Christoph M. Becker" <cmbecker69@arcor.de>
Date2016-07-13 14:30 +0200
Message-ID<nm5c8v$cjn$1@solani.org>
In reply to#30843
On 12.07.2016 at 08:41, Robert Baer wrote:

> <script type="text/javascript">
> 
> // do not know what to do to get those variables

Read <http://pointedears.de/scripts/faq/cljs/#domRef>.

>     document.writeln("getElementById via value does not work and
> crashes.<BR>");
> //    Qnam=document.getElementById("QN").value;

Obviously, there is no element with id "QN".  Therefore
document.getElementById("QN") returns `undefined`.  Accessing a property
of `undefined` is supposed to error.

> //  following gives undefined
> //    Qmsg=document.getElementsByName("form-control").innerHTML ;
> //    document.writeln(Qmsg+"|<BR>");

There is no element with name "form-control".

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#30860

FromRobert Baer <robertbaer@localnet.com>
Date2016-07-13 23:56 -0800
Message-ID<FAHhz.1851$7L2.198@fx19.iad>
In reply to#30855
Christoph M. Becker wrote:
> On 12.07.2016 at 08:41, Robert Baer wrote:
>
>> <script type="text/javascript">
>>
>> // do not know what to do to get those variables
>
> Read<http://pointedears.de/scripts/faq/cljs/#domRef>.
>
>>      document.writeln("getElementById via value does not work and
>> crashes.<BR>");
>> //    Qnam=document.getElementById("QN").value;
>
> Obviously, there is no element with id "QN".  Therefore
> document.getElementById("QN") returns `undefined`.  Accessing a property
> of `undefined` is supposed to error.
>
>> //  following gives undefined
>> //    Qmsg=document.getElementsByName("form-control").innerHTML ;
>> //    document.writeln(Qmsg+"|<BR>");
>
> There is no element with name "form-control".
>
   I think that has settled the mud in my pond (so to speak).
   My interpretation: the HTML code _must_ say id="gert" to have an 
element with id of "gert"; likewise the code must say name="foodle" to 
have an element with name"foodle".
   =*SPLAT*=
   How utterly simple and direct!
   Am i dummy or what!

   Thanks!!!
   PS: Also thanks for that article by pointedears, it is par excellence!

[toc] | [prev] | [next] | [standalone]


#30873

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2016-07-15 11:32 +0200
Message-ID<5093913.MhkbZ0Pkbq@PointedEars.de>
In reply to#30860
Robert Baer wrote:

> Christoph M. Becker wrote:
>> On 12.07.2016 at 08:41, Robert Baer wrote:
>>> <script type="text/javascript">
>>>
>>> // do not know what to do to get those variables
>>
>> Read<http://pointedears.de/scripts/faq/cljs/#domRef>.
>> […]
>    PS: Also thanks for that article by pointedears, it is par excellence!

Thank you, also on behalf of the contributors.  But credit where credit is 
due: I am only the FAQ maintainer and editor.  While some of my postings may 
have influenced it, and I would have written this section in a similar way, 
most of the content of the FAQ, including this section, was contributed by 
other people to the FAQ it is based on before I took over.

Keep in mind that while it is more up-to-date than the old FAQ, most of the 
new FAQ has not been updated in a while (this particular section does not 
need considerable updating, though).  This is in part my fault, as I have 
not made as much time for maintenance as I wanted to.  However, maintenance 
would be easier for me if more people would contribute, more substantially, 
and more often; preferably, as it is possible since 2015-12-13, via Pull 
Request.

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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web