Alert????

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dimple.nshah@gmail.com

    Alert????


    Hello,

    I am trying to figure out the functionality of alert in javascript. I
    have a form with about 5 fields. Each field has a check on whether the
    information entered is valid. If the user enters an invalid
    information, a alert box pops up. My problem is, if I say OK on the
    alert box, the entire page is refreshed. Is there any way in which
    only that particular field (in which invalid information is entered)
    is refreshed and the remaining fields are as they were?

    Thanks in advance.
    Dimple.
  • Jeremy J Starcher

    #2
    Re: Alert????

    On Tue, 04 Mar 2008 10:43:14 -0800, dimple.nshah wrote:
    I am trying to figure out the functionality of alert in javascript. I
    have a form with about 5 fields. Each field has a check on whether the
    information entered is valid. If the user enters an invalid information,
    a alert box pops up. My problem is, if I say OK on the alert box, the
    entire page is refreshed. Is there any way in which only that particular
    field (in which invalid information is entered) is refreshed and the
    remaining fields are as they were?

    Without code, I can only guess as to the issue.

    My first guess is not returning false from an event handler.

    That said, Alert tends to be an awkward and annoying way to handle entry
    errors, ESPECIALLY if done on a field-by-field basis.

    Comment

    • Evertjan.

      #3
      Re: Alert????

      wrote on 04 mrt 2008 in comp.lang.javas cript:
      I am trying to figure out the functionality of alert in javascript. I
      have a form with about 5 fields. Each field has a check on whether the
      information entered is valid. If the user enters an invalid
      information, a alert box pops up. My problem is, if I say OK on the
      alert box, the entire page is refreshed. Is there any way in which
      only that particular field (in which invalid information is entered)
      is refreshed and the remaining fields are as they were?
      Yes and no.

      Yes it is possible and No that would not be called refresh.
      The discussion however is meaningless without you showing your code.
      Please only show the essential part.


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

      Comment

      • Doug Miller

        #4
        Re: Alert????

        In article <e4ec66ad-92a0-425b-a5c9-d7ef1c0e4fa8@60 g2000hsy.google groups.com>, dimple.nshah@gm ail.com wrote:
        >You mean I need to check if the date is in proper format, inside HTML
        >itself???
        No, in your javascript.

        --
        Regards,
        Doug Miller (alphageek at milmac dot com)

        It's time to throw all their damned tea in the harbor again.

        Comment

        • Evertjan.

          #5
          Re: Alert????

          Doug Miller wrote on 05 mrt 2008 in comp.lang.javas cript:
          Irrelevant. No form should ever ask for today's date.
          You "ever" is wrong,
          there are many instances where it is apropriate to do so.

          In medicine it is one of the first questions asked to estimate the
          client/patient's desorientation. It could be used to correct errors with
          the computer's clock off line, or to set a virtual reality time in a
          simulation.

          Speaking about a form [or a letter] asking is a strong humanisation,
          a form is just a instrument of asking, but I like that. ;-)

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

          Comment

          • Thomas 'PointedEars' Lahn

            #6
            Re: Alert????

            Tim Streater wrote:
            In article <47CE7EF7.90806 04@PointedEars. de>,
            Thomas 'PointedEars' Lahn <PointedEars@we b.dewrote:
            >Doug Miller wrote:
            >>[...] Thomas 'PointedEars' Lahn [...] wrote:
            >>>Doug Miller wrote:
            >>>>[...] dimple.nshah@gm ail.com wrote:
            >>>>>I am actually writing date validation. Here is the scripting part:
            >>>>>>
            >>>>>// Date Validation for Today's Date (date should be in mm/dd/yyyy
            >>>>>form)
            >>>Date input formats on an international medium like the Web should follow
            >>>internationa lly standardized formats, such as ISO 8601 (YYYY-MM-DD), or
            >>>provide a control for every date component.
            >
            No, I want it in my local format.
            Irrelevant. Several million other people have ISO 8601 as their local
            format. However, L10n could include an option for user-defined display.
            The point was, it is a bad idea for a Web application to use the localized
            format *by default*.


            PointedEars
            --
            realism: HTML 4.01 Strict
            evangelism: XHTML 1.0 Strict
            madness: XHTML 1.1 as application/xhtml+xml
            -- Bjoern Hoehrmann

            Comment

            • Tim Streater

              #7
              Re: Alert????

              In article <47CE8B82.10804 00@PointedEars. de>,
              Thomas 'PointedEars' Lahn <PointedEars@we b.dewrote:
              Tim Streater wrote:
              In article <47CE7EF7.90806 04@PointedEars. de>,
              Thomas 'PointedEars' Lahn <PointedEars@we b.dewrote:
              Doug Miller wrote:
              >[...] Thomas 'PointedEars' Lahn [...] wrote:
              >>Doug Miller wrote:
              >>>[...] dimple.nshah@gm ail.com wrote:
              >>>>I am actually writing date validation. Here is the scripting part:
              >>>>>
              >>>>// Date Validation for Today's Date (date should be in mm/dd/yyyy
              >>>>form)
              >>Date input formats on an international medium like the Web should follow
              >>international ly standardized formats, such as ISO 8601 (YYYY-MM-DD), or
              >>provide a control for every date component.
              No, I want it in my local format.
              >
              Irrelevant. Several million other people have ISO 8601 as their local
              format. However, L10n could include an option for user-defined display.
              The point was, it is a bad idea for a Web application to use the localized
              format *by default*.
              Why? I would call it a good idea for the page to consult my local
              settings for date format display.

              Comment

              • Dr J R Stockton

                #8
                Re: Alert????

                In comp.lang.javas cript message <83e90c08-bb1e-4942-8a70-7fa5ba510145@s3
                7g2000prg.googl egroups.com>, Tue, 4 Mar 2008 11:01:48,
                dimple.nshah@gm ail.com posted:
                >
                >I am actually writing date validation.
                If you had read the newsgroup FAQ with reasonable care before the
                relevant line was removed, you would have been lead to a much more
                concise way of validating a numeric Y M D date in JavaScript. See
                below.

                A Google search for JavaScript date validation will soon show that
                there's no need to write new bad code, since the Web offers plenty; and
                will give you an idea of the quality of the average web tutorial.

                It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

                --
                (c) John Stockton, nr London UK. ?@merlyn.demon. co.uk IE6 IE7 FF2 Op9 Sf3
                news:comp.lang. javascript FAQ <URL:http://www.jibbering.c om/faq/index.html>.
                <URL:http://www.merlyn.demo n.co.uk/js-index.htmjscr maths, dates, sources.
                <URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.

                Comment

                • Doug Miller

                  #9
                  Re: Alert????

                  In article <Xns9A586097F17 62eejj99@194.10 9.133.242>, "Evertjan." <exjxw.hannivoo rt@interxnl.net wrote:
                  >Doug Miller wrote on 05 mrt 2008 in comp.lang.javas cript:
                  >
                  >Irrelevant. No form should ever ask for today's date.
                  >
                  >You "ever" is wrong,
                  >there are many instances where it is apropriate to do so.
                  Too bad you failed to provide any.
                  >
                  >In medicine it is one of the first questions asked to estimate the
                  >client/patient's desorientation.
                  Nonsense. While you're right about the question, you've completely
                  misunderstood its significance: the information being entered into the
                  medical record is not "today's date" but rather "what the patient THINKS is
                  today's date".

                  Strike one.
                  It could be used to correct errors with
                  >the computer's clock off line,
                  Garbage. Correcting errors with the computer's clock would be done so by
                  setting the clock directly, not by entering the date into a form on a web
                  page.

                  Strike two.
                  >or to set a virtual reality time in a
                  >simulation.
                  A VR sim using javascript in a web browser?

                  Strike three. You're out.

                  Comment

                  • Doug Miller

                    #10
                    Re: Alert????

                    In article <47CE7EF7.90806 04@PointedEars. de>, Thomas 'PointedEars' Lahn <cljs@PointedEa rs.dewrote:
                    >[flame snipped]
                    >
                    <
                    Pedant. This is of course going to be the case the vast majority of the time,
                    as you are doubtless aware. In any event it's certainly easy enough to display
                    what the computer thinks (is that better?) is today's date as a default value.

                    The point remains that requiring the user to type in *any* information that
                    can be determined in advance by the software, especially something so simple
                    and straightforward as today's date, is asinine.
                    >
                    Your conspicuous failure to address these points is noted without surprise.

                    Comment

                    • Evertjan.

                      #11
                      Re: Alert????

                      Doug Miller wrote on 06 mrt 2008 in comp.lang.javas cript:
                      In article <Xns9A586097F17 62eejj99@194.10 9.133.242>, "Evertjan."
                      <exjxw.hannivoo rt@interxnl.net wrote:
                      >>Doug Miller wrote on 05 mrt 2008 in comp.lang.javas cript:
                      >>
                      >>Irrelevant. No form should ever ask for today's date.
                      >>
                      >>You "ever" is wrong,
                      >>there are many instances where it is apropriate to do so.
                      >
                      Too bad you failed to provide any.
                      >>
                      >>In medicine it is one of the first questions asked to estimate the
                      >>client/patient's desorientation.
                      >
                      Nonsense. While you're right about the question, you've completely
                      misunderstood its significance: the information being entered into the
                      medical record is not "today's date" but rather "what the patient
                      THINKS is today's date".
                      >
                      Strike one.
                      >
                      >It could be used to correct errors with
                      >>the computer's clock off line,
                      >
                      Garbage. Correcting errors with the computer's clock would be done so
                      by setting the clock directly, not by entering the date into a form on
                      a web page.
                      >
                      Strike two.
                      >
                      >>or to set a virtual reality time in a
                      >>simulation.
                      >
                      A VR sim using javascript in a web browser?
                      >
                      Strike three. You're out.
                      Your game is your private virtual reality.

                      I am glad for you, you feel happy having strikes.
                      However for me this is not a game,
                      not even a game I do not know or want to know,
                      I was talking about reality.

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

                      Comment

                      Working...