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


Groups > comp.lang.javascript > #30850

Re: How fetch data from form for javascript screening

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: How fetch data from form for javascript screening
Date 2016-07-13 01:09 +0200
Organization PointedEars Software (PES)
Message-ID <1692390.PYKUYFuaPT@PointedEars.de> (permalink)
References <ti0hz.37337$Z95.7322@fx29.iad> <7944450.CDJkKcVGEf@PointedEars.de> <Itdhz.1$uD.0@fx17.iad>

Show all headers | View raw


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.

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


Thread

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

csiph-web