Good validation package

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • milkyway

    Good validation package

    Hello,

    Is there a good validation package out there that can be used with
    javascript? I have tried the one here:



    but had some problems implementing it ;-(

    I have seen the one from Dreamweaver but I am not using this package.

    Is there anything else out there that one can use?
    Any help, hints or advice would be appreciated ;-)

    TIA

  • Michael Winter

    #2
    Re: Good validation package

    On 13 Dec 2004 11:05:19 -0800, milkyway <d0mufasa@hotma il.com> wrote:

    [snip]
    [color=blue]
    > I have tried the one here:
    >
    > http://www.peterbailey.net/fValidate/
    >
    > but had some problems implementing it ;-([/color]

    I'm somewhat glad. Serving up over 50KBs of code to validate a few form
    controls is stupid.
    [color=blue]
    > I have seen the one from Dreamweaver but I am not using this package.[/color]

    Most of the code I've seen generated by Dreamweaver is rubbish. I'd be
    surprised if the form validation stuff is any better.
    [color=blue]
    > Is there anything else out there that one can use?[/color]

    What are you actually trying to validate? It's far more sensible to use
    something small and efficient.
    [color=blue]
    > Any help, hints or advice would be appreciated ;-)[/color]

    On a different topic, please post to appropriate newsgroups. This solution
    has nothing to do with Java, and ciwah deals with authoring HTML on the
    Web not scripting.

    Follow-ups set to c.l.js.

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.

    Comment

    • milkyway

      #3
      Re: Good validation package

      HI - sorry about the posting. Just still learning all of this.

      I am trying to validate data for: strings, numbers, money, social,
      phone number, date and zipcode.

      I had thought that there would be a way to validate these things on the
      client side.

      Any ideas?

      Kind Regards.

      Comment

      • Heiner Kücker

        #4
        Re: Good validation package

        Michael Winter wrote[color=blue]
        > On 13 Dec 2004 11:05:19 -0800, milkyway <d0mufasa@hotma il.com> wrote:
        >
        > [snip]
        >[color=green]
        > > I have tried the one here:
        > >
        > > http://www.peterbailey.net/fValidate/
        > >
        > > but had some problems implementing it ;-([/color]
        >
        > I'm somewhat glad. Serving up over 50KBs of code to validate a few form
        > controls is stupid.
        >[color=green]
        > > I have seen the one from Dreamweaver but I am not using this package.[/color]
        >
        > Most of the code I've seen generated by Dreamweaver is rubbish. I'd be
        > surprised if the form validation stuff is any better.
        >[color=green]
        > > Is there anything else out there that one can use?[/color]
        >
        > What are you actually trying to validate? It's far more sensible to use
        > something small and efficient.
        >[color=green]
        > > Any help, hints or advice would be appreciated ;-)[/color]
        >
        > On a different topic, please post to appropriate newsgroups. This solution
        > has nothing to do with Java, and ciwah deals with authoring HTML on the
        > Web not scripting.
        >
        > Follow-ups set to c.l.js.
        >
        > Mike
        >
        > --
        > Michael Winter
        > Replace ".invalid" with ".uk" to reply by e-mail.[/color]

        When the javascript is included with the

        <link rel="script" type="text/javascript" href="URI/xxx.js">

        <LINK REL="STYLESHEET " TYPE="TEXT/JAVASCRIPT" HREF="classes.j ss">

        Tag, then the javascript exists only one time on the the client.

        see at

        This website is for sale! iota-six.co.uk is your first and best source for information about iota six. Here you will also find topics relating to issues of general interest. We hope you find what you are looking for!


        search over ctrl f 'link'

        --
        Heiner Kuecker
        Internet: http://www.heinerkuecker.de http://www.heiner-kuecker.de
        JSP WorkFlow PageFlow Page Flow FlowControl Navigation: http://www.control-and-command.de
        Java Expression Formula Parser: http://www.heinerkuecker.de/Expression.html
        CnC Template Technology http://www.heinerkuecker.de/Expression.html#templ


        Comment

        • Michael Winter

          #5
          Re: Good validation package

          On Mon, 13 Dec 2004 23:30:47 +0100, Heiner Kücker <Mail@Heiner-Kuecker.de>
          wrote:

          [snip]
          [color=blue]
          > When the javascript is included with the
          >
          > <link rel="script" type="text/javascript" href="URI/xxx.js">[/color]

          Excuse me? You don't include scripts with LINK elements.
          [color=blue]
          > <LINK REL="STYLESHEET " TYPE="TEXT/JAVASCRIPT" HREF="classes.j ss">[/color]

          As far as I'm aware, only Netscape supports JSS, so what is the point?

          [snip]

          Mike

          --
          Michael Winter
          Replace ".invalid" with ".uk" to reply by e-mail.

          Comment

          • Randy Webb

            #6
            Re: Good validation package

            Michael Winter wrote:
            [color=blue]
            > On Mon, 13 Dec 2004 23:30:47 +0100, Heiner Kücker
            > <Mail@Heiner-Kuecker.de> wrote:
            >
            > [snip]
            >[color=green]
            >> <LINK REL="STYLESHEET " TYPE="TEXT/JAVASCRIPT" HREF="classes.j ss">[/color]
            >
            >
            > As far as I'm aware, only Netscape supports JSS, so what is the point?[/color]

            What does and doesn't support JSS is irrelevant though, is it not?

            <script type="text/javascript" src="someFile.s omeMadeUpExtens tion">

            As long as whats in that file is valid JS code, the browser couldn't
            care less what the extension is :-)


            --
            Randy
            comp.lang.javas cript FAQ - http://jibbering.com/faq

            Comment

            • Michael Winter

              #7
              Re: Good validation package

              On Mon, 13 Dec 2004 17:56:43 -0500, Randy Webb <HikksNotAtHome @aol.com>
              wrote:

              [snip]
              [color=blue]
              > What does and doesn't support JSS is irrelevant though, is it not?[/color]

              I think that the poster was, for some reason, referring specifically to
              Javascript Style Sheets. Why? I don't know.
              [color=blue]
              > <script type="text/javascript" src="someFile.s omeMadeUpExtens tion">
              >
              > As long as whats in that file is valid JS code, the browser couldn't
              > care less what the extension is :-)[/color]

              I know that! :P

              Mike

              --
              Michael Winter
              Replace ".invalid" with ".uk" to reply by e-mail.

              Comment

              • Michael Winter

                #8
                Re: Good validation package

                On 13 Dec 2004 12:25:16 -0800, milkyway <d0mufasa@hotma il.com> wrote:
                [color=blue]
                > HI - sorry about the posting. Just still learning all of this.
                >
                > I am trying to validate data for: strings, numbers, money, social, phone
                > number, date and zipcode.[/color]

                You're going to have to be more specific than that, especially considering
                that I'm in a different country than you. I've had a quick look for
                US-specific formats, but I might be the victim of misinformation.

                - Strings
                Are you just looking for strings that aren't zero-length or
                composed solely of white-space, or more complex? The former would
                be

                /^\S+$/ or /^\S+( \S+)*$/

                if you want a space-separated sequence.

                - Numbers
                Easy, but again varied.

                - Integers? /^(0|[1-9]\d*)$/
                - Reals? /^(0|[1-9]\d*)\.\d+$/
                - Possibly both? /^(0|[1-9]\d*)(\.\d+)?$/

                - Money
                /^(0|[1-9]\d*)(\.\d\d)?$/

                though you might want to limit the number of digits before the
                decimal place.

                - Social (Security?)
                /^\d{3}-\d\d-\d{4}$/

                - Phone number
                Phone numbers are notoriously difficult as different systems,
                even within the same country, can vary. If you have to deal with
                international numbers, you're in for a real treat.

                - Date
                Which format(s)? If you expect international audiences, a
                locale-specific format such as mm/dd/yyyy is generally a bad idea.

                - Zipcode
                /^\d{5}$/ or /^\d{5}(-\d{4})?$/

                for optional inclusion of the extra four digits

                To use the regular expression literals above, you'd append

                .test(...)

                where the ellipses represents a string value. For example,

                if(/^(0|[1-9]\d*)$/.test(str)) {
                /* The string, str, contains a valid integer. */
                }
                [color=blue]
                > I had thought that there would be a way to validate these things on the
                > client side.[/color]

                Undoubtably, but if you haven't so far, worry about validation on the
                server first. That's more important.

                Mike

                --
                Michael Winter
                Replace ".invalid" with ".uk" to reply by e-mail.

                Comment

                • Flash Nick

                  #9
                  Re: Good validation package

                  Form Validation bundled with Dreamweaver is pretty basic but works.

                  There are extensions that are available at Macromedia's Exchange that
                  plug into Dreamweaver and are more robust and if you don't like anything
                  you find you can always use your own Form Validation code in
                  Dreamweaver. Coding in Dreamweaver is pretty good since it swallowed
                  Homesite.....

                  --
                  FN

                  Comment

                  • Dr John Stockton

                    #10
                    Re: Good validation package

                    JRS: In article <1102969516.735 695.297080@f14g 2000cwb.googleg roups.com>
                    , dated Mon, 13 Dec 2004 12:25:16, seen in news:comp.lang. javascript,
                    milkyway <d0mufasa@hotma il.com> posted :[color=blue]
                    >HI - sorry about the posting. Just still learning all of this.[/color]

                    Read the newsgroup FAQ.
                    [color=blue]
                    >I am trying to validate data for: strings, numbers, money, social,
                    >phone number, date and zipcode.
                    >
                    >I had thought that there would be a way to validate these things on the
                    >client side.
                    >
                    >Any ideas?[/color]

                    Read <URL:http://www.merlyn.demo n.co.uk/js-valid.htm>.

                    You do not indicate what country you are in, so can be supposed to be
                    American. Remember overseas customers, and non-USA Americans. Even if
                    you supply only within the USA, you customers may be using a non-US
                    location. Do not over-validate.

                    --
                    © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
                    <URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
                    <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
                    <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

                    Comment

                    • Randy Webb

                      #11
                      Re: Good validation package

                      Flash Nick wrote:
                      [color=blue]
                      > Form Validation bundled with Dreamweaver is pretty basic but works.[/color]

                      That depends, entirely, upon your definition of "works".

                      99.99% of code generated by Dreamweaver is utterly useless space wasting
                      garbage. I stopped short of 100% in the hopes that one day they may
                      actually get a clue about scripting and produce something worth using.

                      [color=blue]
                      >Coding in Dreamweaver is pretty good since it swallowed Homesite.....[/color]

                      Using it as an editor may be "pretty good" but the code it produces is
                      still garbage.

                      --
                      Randy
                      comp.lang.javas cript FAQ - http://jibbering.com/faq
                      Answer:It destroys the order of the conversation
                      Question: Why?
                      Answer: Top-Posting.
                      Question: Whats the most annoying thing on Usenet?

                      Comment

                      • milkyway

                        #12
                        Re: Good validation package

                        Thank you for the information ;-) I will try these out

                        Kindest Regards.

                        Michael Winter wrote:[color=blue]
                        > On 13 Dec 2004 12:25:16 -0800, milkyway <d0mufasa@hotma il.com> wrote:
                        >[color=green]
                        > > HI - sorry about the posting. Just still learning all of this.
                        > >
                        > > I am trying to validate data for: strings, numbers, money, social,[/color][/color]
                        phone[color=blue][color=green]
                        > > number, date and zipcode.[/color]
                        >
                        > You're going to have to be more specific than that, especially[/color]
                        considering[color=blue]
                        > that I'm in a different country than you. I've had a quick look for
                        > US-specific formats, but I might be the victim of misinformation.
                        >
                        > - Strings
                        > Are you just looking for strings that aren't zero-length or
                        > composed solely of white-space, or more complex? The former[/color]
                        would[color=blue]
                        > be
                        >
                        > /^\S+$/ or /^\S+( \S+)*$/
                        >
                        > if you want a space-separated sequence.
                        >
                        > - Numbers
                        > Easy, but again varied.
                        >
                        > - Integers? /^(0|[1-9]\d*)$/
                        > - Reals? /^(0|[1-9]\d*)\.\d+$/
                        > - Possibly both? /^(0|[1-9]\d*)(\.\d+)?$/
                        >
                        > - Money
                        > /^(0|[1-9]\d*)(\.\d\d)?$/
                        >
                        > though you might want to limit the number of digits before the
                        > decimal place.
                        >
                        > - Social (Security?)
                        > /^\d{3}-\d\d-\d{4}$/
                        >
                        > - Phone number
                        > Phone numbers are notoriously difficult as different systems,
                        > even within the same country, can vary. If you have to deal with
                        > international numbers, you're in for a real treat.
                        >
                        > - Date
                        > Which format(s)? If you expect international audiences, a
                        > locale-specific format such as mm/dd/yyyy is generally a bad[/color]
                        idea.[color=blue]
                        >
                        > - Zipcode
                        > /^\d{5}$/ or /^\d{5}(-\d{4})?$/
                        >
                        > for optional inclusion of the extra four digits
                        >
                        > To use the regular expression literals above, you'd append
                        >
                        > .test(...)
                        >
                        > where the ellipses represents a string value. For example,
                        >
                        > if(/^(0|[1-9]\d*)$/.test(str)) {
                        > /* The string, str, contains a valid integer. */
                        > }
                        >[color=green]
                        > > I had thought that there would be a way to validate these things on[/color][/color]
                        the[color=blue][color=green]
                        > > client side.[/color]
                        >
                        > Undoubtably, but if you haven't so far, worry about validation on the[/color]
                        [color=blue]
                        > server first. That's more important.
                        >
                        > Mike
                        >
                        > --
                        > Michael Winter
                        > Replace ".invalid" with ".uk" to reply by e-mail.[/color]

                        Comment

                        • milkyway

                          #13
                          Re: Good validation package

                          Thanks to all for the help ;-p


                          Dr John Stockton wrote:[color=blue]
                          > JRS: In article[/color]
                          <1102969516.735 695.297080@f14g 2000cwb.googleg roups.com>[color=blue]
                          > , dated Mon, 13 Dec 2004 12:25:16, seen in news:comp.lang. javascript,
                          > milkyway <d0mufasa@hotma il.com> posted :[color=green]
                          > >HI - sorry about the posting. Just still learning all of this.[/color]
                          >
                          > Read the newsgroup FAQ.
                          >[color=green]
                          > >I am trying to validate data for: strings, numbers, money, social,
                          > >phone number, date and zipcode.
                          > >
                          > >I had thought that there would be a way to validate these things on[/color][/color]
                          the[color=blue][color=green]
                          > >client side.
                          > >
                          > >Any ideas?[/color]
                          >
                          > Read <URL:http://www.merlyn.demo n.co.uk/js-valid.htm>.
                          >
                          > You do not indicate what country you are in, so can be supposed to be
                          > American. Remember overseas customers, and non-USA Americans. Even[/color]
                          if[color=blue]
                          > you supply only within the USA, you customers may be using a non-US
                          > location. Do not over-validate.
                          >
                          > --
                          > © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00[/color]
                          IE 4 ©[color=blue]
                          > <URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of[/color]
                          news:comp.lang. javascript[color=blue]
                          > <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates,[/color]
                          sources.[color=blue]
                          > <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ[/color]
                          items, links.

                          Comment

                          • Dr John Stockton

                            #14
                            Re: Good validation package

                            JRS: In article <1103089627.321 875.248720@z14g 2000cwz.googleg roups.com>
                            , dated Tue, 14 Dec 2004 21:47:07, seen in news:comp.lang. javascript,
                            milkyway <d0mufasa@hotma il.com> posted :
                            [color=blue]
                            >Lines: 39[/color]
                            [color=blue]
                            >Thanks to all for the help ;-p
                            >
                            >
                            >Dr John Stockton wrote:[color=green]
                            >> JRS: In article[/color]
                            ><1102969516.73 5695.297080@
                            > ... ...[/color]


                            If you think that you may need more help, read and respect FAQ sec 2.3,
                            especially paragraphs 1 & 6.

                            --
                            © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
                            <URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
                            <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
                            <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

                            Comment

                            • milkyway

                              #15
                              Re: Good validation package

                              I don't know if anyone is watching this but I found something (don't
                              know if it is actually good or not) in the struts examples found on the
                              apache strut website. There are .war files there for examples you can
                              use to work with struts. One of the examples has a good amount of
                              javascript code (that is used as part of a form validation example).

                              You can see the list of packages offered here


                              under the bullet of "Other Packages". Again, *one* of these .war files
                              has javascript validation code. I think it is the one called
                              "Validator" .

                              Comment

                              Working...