Javascript form validation - comments please

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Toby A Inkster

    #61
    Re: Javascript form validation - comments please

    Stephen Poley wrote:
    [color=blue]
    > I don't think there are any web-browsers in the
    > wild which handle stylesheets but not CSS - are there?[/color]

    No, but there are browsers that handle non-CSS style sheets (e.g. XSLT in
    MSIE and Mozilla; JSSS in NN4)

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

    Comment

    • Stephen Poley

      #62
      Re: Javascript form validation - comments please

      On Sat, 06 Dec 2003 16:09:44 GMT, jim@jibbering.c om (Jim Ley) wrote:
      [color=blue]
      >On Sat, 6 Dec 2003 02:09:51 -0000, "Richard Cornford"
      ><Richard@litot es.demon.co.uk> wrote:
      >[color=green]
      >>"Stephen Poley" <sbpoley@xs4all .nl> wrote in message
      >>news:8aq1tv8p ignda65op83sl7e c8bnucev9e1@4ax .com...
      >>
      >>|if (!elem.firstChi ld && !elem.innerHTML )
      >>
      >>I forgot to mention that the innerHTML test may not be the best as empty
      >>strings type-convert to boolean false, so - !elem.innerHTML - will be
      >>true if the innerHTML string exists but is empty.[/color]
      >
      >I don't like innerHTML for a different reason... that is it could be
      >read-only or whatever,[/color]

      Perhaps you could explain a bit. Under what circumstances would that
      arise?
      [color=blue]
      > so if you're going to test to see if changing
      >innerHTML works you can do it with
      >
      >foo.innerHTML= '<b>Chickens</b>'
      >
      >if (foo.childNodes etc. or whatever non innerHTML methods you prefer
      >to test the existence of elements.[/color]

      I'd be happy to bin innerHTML completely, but I understand that it's the
      best available with IE - unless you know different?

      --
      Stephen Poley


      Comment

      • Stephen Poley

        #63
        Re: Javascript form validation - comments please

        On Sat, 6 Dec 2003 08:00:10 +0100, "Nico Schuyt" <nschuyt@hotmai l.com>
        wrote:
        [color=blue]
        >Stephen Poley wrote:[color=green]
        >> http://www.xs4all.nl/~sbpoley/webmatters/formval.html[/color]
        >
        >Nice! But why still apply js when the server side testing is so complete?[/color]

        I do try to explain that on the page.
        [color=blue]
        >IMO the form should :
        >- use cookies to prevent people have to fill in all the fields again next
        >time[/color]

        Could be appropriate in some cases, but OTOH some forms tend only to get
        filled in once. And of course quite a lot of people have cookies
        disabled. A bit out of the scope of this article.
        [color=blue]
        >- send a copy of the mail to the sender (I hate to make copies myself or not
        >knowing later what exactly I submitted)[/color]

        Good point, but not an appropriate feature of the form itself - that
        would need to be done by the server script. (And one would of course
        need anti-spammer precautions).

        --
        Stephen Poley


        Comment

        • Stephen Poley

          #64
          Re: Javascript form validation - comments please

          On Tue, 09 Dec 2003 14:30:14 +0000, Vigil <me@privacy.net > wrote:
          [color=blue]
          >Hmm. I am using Opera 7.23 on an Athlon XP 2something. I have also checked
          >with the Mozillas and MSIE in WinXP (same machine). Always the CPU load
          >goes up. Try running a CPU load monitor and yours should too.
          >Alternativel y, make a test page without the static bg and put them side by
          >side, scroll each and you might notice the static bg page is slightly less
          >smooth (depending on your CPU, of course). I've heard it reported that it
          >does it on all browsers.
          >
          >On Mon, 08 Dec 2003 16:16:35 +0100, Stephen Poley wrote:
          >[color=green][color=darkred]
          >>>Is it just me that is sent
          >>>into CPU overwork when a static bg is used?[/color]
          >>
          >> I've had one person complain about that before; it turned out he was
          >> running Netscape 7 / Mozilla (I forget which) on a machine slower than
          >> the recommended minimum hardware configuration. What is your
          >> configuration?[/color][/color]

          I did make a test page as you suggested, but I couldn't see any
          difference to the smoothness of scrolling. The CPU load went up to 100%
          in both cases. I'm using Opera 7.21.

          Not sure what my CPU is, but it was the slowest [1] I could find when I
          bought it just under 18 months ago.

          [1] OK, cheapest.

          --
          Stephen Poley


          Comment

          • Lasse Reichstein Nielsen

            #65
            Re: Javascript form validation - comments please

            Toby A Inkster <UseTheAddressI nMySig@deadspam .com> writes:
            [color=blue]
            > Stephen Poley wrote:
            >[color=green]
            >> '@type'?[/color]
            >
            > Short for 'the attribute "type"'. This derives from the XPath spec.[/color]

            Bad choice in combination with @media, which is a CSS declaration.

            /L
            --
            Lasse Reichstein Nielsen - lrn@hotpop.com
            DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
            'Faith without judgement merely degrades the spirit divine.'

            Comment

            • Lasse Reichstein Nielsen

              #66
              Re: Javascript form validation - comments please

              Stephen Poley <sbpoley@xs4all .nl> writes:
              [color=blue]
              > I'd be happy to bin innerHTML completely, but I understand that it's the
              > best available with IE - unless you know different?[/color]

              It is the best available to IE 4.
              You can use W3C DOM methods in IE 5 and forward.

              IE 4 is about as usable as Netscape 4, but both still have users. Sadly.

              /L
              --
              Lasse Reichstein Nielsen - lrn@hotpop.com
              DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
              'Faith without judgement merely degrades the spirit divine.'

              Comment

              • Dr John Stockton

                #67
                Re: Javascript form validation - comments please

                JRS: In article <pan.2003.12.09 .07.35.02.43556 2@goddamn.co.uk >, seen in
                news:comp.lang. javascript, Toby A Inkster <UseTheAddressI nMySig@deadspam
                ..com> posted at Tue, 9 Dec 2003 07:35:06 :-[color=blue]
                >Dr John Stockton wrote:
                >[color=green]
                >> But the distribution does not include the manual;[/color]
                >
                >Mine did.
                >[/color]

                If you got a version that will run at a Win98 DOS prompt, what was the
                URL you got it from?

                --
                © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
                <URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
                <URL:http://www.merlyn.demo n.co.uk/js-index.htm> JSc maths, dates, sources.
                <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/JSc/&c, FAQ topics, links.

                Comment

                • Toby A Inkster

                  #68
                  Re: Javascript form validation - comments please

                  Dr John Stockton wrote:
                  [color=blue]
                  > If you got a version that will run at a Win98 DOS prompt, what was the
                  > URL you got it from?[/color]

                  No, I have a version that runs from the Linux tcsh prompt.

                  --
                  Toby A Inkster BSc (Hons) ARCS
                  Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

                  Comment

                  • Thomas 'PointedEars' Lahn

                    #69
                    Re: Javascript form validation - comments please

                    Stephen Poley wrote:
                    [color=blue]
                    > My feeling is that if an error can only be triggered by an *authoring*
                    > mistake (such as mistyping an id) then it's probably better to let it
                    > trigger a Javascript error which tells the author where to look, rather
                    > than have it do nothing and leave one scratching ones head.[/color]

                    The problem is that JavaScript errors are not always visibly announced,
                    so if you want to make sure that authors see their mistakes, you need
                    to use alert(...).

                    BTW please stop crossposting, this ha[ds] nothing to do with HTML anymore.


                    F'up2 cljs

                    PointedEars

                    Comment

                    • Vigil

                      #70
                      Re: Javascript form validation - comments please

                      Odd that it should go up to 100% on a 'normal' (no static bg) page...

                      On Tue, 09 Dec 2003 22:06:12 +0100, Stephen Poley wrote:
                      [color=blue]
                      > I did make a test page as you suggested, but I couldn't see any difference
                      > to the smoothness of scrolling. The CPU load went up to 100% in both
                      > cases. I'm using Opera 7.21.[/color]

                      --

                      ..

                      Comment

                      • Dr John Stockton

                        #71
                        Re: On a slightly different topic

                        JRS: In article <br58m901kjt@dr n.newsguy.com>, seen in
                        news:comp.lang. javascript, Lee <REM0VElbspamtr ap@cox.net> posted at Tue,
                        9 Dec 2003 11:44:09 :-[color=blue]
                        >Tux said:[color=green]
                        >>
                        >>I want to produce a form for competition entry which would need minimal
                        >>editing from year to year. Since the entrants to the competition would have
                        >>to have birthdates between certain limits I would want to calculate these
                        >>and add the results to a selection list, something like
                        >>
                        >><select>
                        >><option>Und er-10 (born 1994 to 1996</option>
                        >><option>Und er-12 (born 1992 or 1993</option>[/color][/color]
                        [color=blue]
                        >If a person was born in a certain year, that doesn't tell you
                        >how old they are now. You need their complete birthdate for
                        >that, which calls for a different sort of input element.[/color]

                        Tux did not say that an entrant is a person; it might be a racehorse.
                        They change age on Jan 1st, IIRC.

                        The OP should probably present a control with such a list of options,
                        with text explaining the definitions. It would be possible, after
                        selection, to present the corresponding DoB range - preferably without
                        misusing "between".

                        --
                        © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME. ©
                        Web <URL:http://www.merlyn.demo n.co.uk/> - w. FAQish topics, links, acronyms
                        PAS EXE etc : <URL:http://www.merlyn.demo n.co.uk/programs/> - see 00index.htm
                        Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.

                        Comment

                        • Dr John Stockton

                          #72
                          Re: Javascript form validation - comments please

                          JRS: In article <pan.2003.12.10 .07.25.04.66723 3@goddamn.co.uk >, seen in
                          news:comp.lang. javascript, Toby A Inkster <UseTheAddressI nMySig@deadspam
                          ..com> posted at Wed, 10 Dec 2003 07:25:09 :-[color=blue]
                          >Dr John Stockton wrote:
                          >[color=green]
                          >> If you got a version that will run at a Win98 DOS prompt, what was the
                          >> URL you got it from?[/color]
                          >
                          >No, I have a version that runs from the Linux tcsh prompt.[/color]

                          In that case, there is not necessarily a later DOS-32 compilation;
                          though the equivalent to what you have ought to be available to me.

                          --
                          © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME. ©
                          Web <URL:http://www.merlyn.demo n.co.uk/> - w. FAQish topics, links, acronyms
                          PAS EXE etc : <URL:http://www.merlyn.demo n.co.uk/programs/> - see 00index.htm
                          Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.

                          Comment

                          • Brucies Torment

                            #73
                            Re: Javascript form validation - comments please


                            HI Bruce,

                            How about ringing your sister and coming over for a BBQ, it's been far
                            too long ???????


                            C'mon


                            *** Sent via Devdex http://www.devdex.com ***
                            Don't just participate in USENET...get rewarded for it!

                            Comment

                            Working...