Validation and popup window question

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

    Validation and popup window question

    After a user clicks the submit button I want a window to come up
    telling them your entry has been submitted.

    I have this code in my page load section which works well.

    Submit.Attribut es.Add("onclick ", "return window.confirm( 'Your entry
    was submitted.')")

    My problem is it's not picking up my validation if the user doesn't
    fill in the text boxes and just hit the submit button they get your
    entry was submitted. How do I get it to see the validation first and
    only submit the page after it's filled out?
  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: Validation and popup window question

    the validation call is added to the onclick event also, but comes after your
    call (but your return prevents the validation call). you can call the
    validation logic yourself, or attach you code to the onsubmit event, which is
    only called after validation. (RegisterOnSubm itStatement).

    though it seems pretty bush to popup an alert that the user pressed the save
    button. confirmation on the response page that it was actually saved seems
    better (and not an alert).


    -- bruce (sqlwork.com)


    "JJ297" wrote:
    After a user clicks the submit button I want a window to come up
    telling them your entry has been submitted.
    >
    I have this code in my page load section which works well.
    >
    Submit.Attribut es.Add("onclick ", "return window.confirm( 'Your entry
    was submitted.')")
    >
    My problem is it's not picking up my validation if the user doesn't
    fill in the text boxes and just hit the submit button they get your
    entry was submitted. How do I get it to see the validation first and
    only submit the page after it's filled out?
    >

    Comment

    • JJ297

      #3
      Re: Validation and popup window question

      On Feb 27, 11:29 am, bruce barker
      <brucebar...@di scussions.micro soft.comwrote:
      the validation call is added to the onclick event also, but comes after your
      call (but your return prevents the validation call). you can call the
      validation logic yourself, or attach you code to the onsubmit event, whichis
      only called after validation. (RegisterOnSubm itStatement).
      >
      though it seems pretty bush to popup an alert that the user pressed the save
      button. confirmation on the response page that it was actually saved seems
      better (and not an alert).
      >
      -- bruce (sqlwork.com)
      >
      >
      >
      "JJ297" wrote:
      After a user clicks the submit button I want a window to come up
      telling them your entry has been submitted.
      >
      I have this code in my page load section which works well.
      >
      Submit.Attribut es.Add("onclick ", "return window.confirm( 'Your entry
      was submitted.')")
      >
      My problem is it's not picking up my validation if the user doesn't
      fill in the text boxes and just hit the submit button they get your
      entry was submitted.  How do I get it to see the validation first and
      only submit the page after it's filled out?- Hide quoted text -
      >
      - Show quoted text -
      I had a label on the page telling the user the page was submitted but
      the user insteads wants a pop-up window.

      How do I set my page up to use RegisterOnSubmi tStatement?

      Comment

      • JJ297

        #4
        Re: Validation and popup window question

        On Feb 27, 12:07 pm, JJ297 <nc...@yahoo.co mwrote:
        On Feb 27, 11:29 am, bruce barker
        >
        >
        >
        >
        >
        <brucebar...@di scussions.micro soft.comwrote:
        the validation call is added to the onclick event also, but comes after your
        call (but your return prevents the validation call). you can call the
        validation logic yourself, or attach you code to the onsubmit event, which is
        only called after validation. (RegisterOnSubm itStatement).
        >
        though it seems pretty bush to popup an alert that the user pressed the save
        button. confirmation on the response page that it was actually saved seems
        better (and not an alert).
        >
        -- bruce (sqlwork.com)
        >
        "JJ297" wrote:
        After a user clicks the submit button I want a window to come up
        telling them your entry has been submitted.
        >
        I have this code in my page load section which works well.
        >
        Submit.Attribut es.Add("onclick ", "return window.confirm( 'Your entry
        was submitted.')")
        >
        My problem is it's not picking up my validation if the user doesn't
        fill in the text boxes and just hit the submit button they get your
        entry was submitted.  How do I get it to see the validation first and
        only submit the page after it's filled out?- Hide quoted text -
        >
        - Show quoted text -
        >
        I had a label on the page telling the user the page was submitted but
        the user insteads wants a pop-up window.
        >
        How do I set my page up to use RegisterOnSubmi tStatement?- Hide quoted text -
        >
        - Show quoted text -
        I got this to work:

        Page.ClientScri pt.RegisterStar tupScript(Me.Ge tType(), "clientScri pt",
        "window.alert(' Your entry was submitted');", True)

        How do I add window.location .href to this script to go to another page?

        Comment

        Working...