Validation after form submitting..

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

    #1

    Validation after form submitting..

    Basically, im redesigning a form page on our website.

    Currently the user submits the form, it does a few javascript checks
    and either submits to the "processstuff.p hp" page, or gives the user a
    JS error message.. where they have to go back and fill the details in.

    Im trying to optimise and make this form/page as best as it can be.

    Do you think it would be a better idea to continue using JS or use JS
    then submit to the php page(where it checks some other details(postcod e
    validation) and submits, or just solely use php validation?

    Im open to ideas please.

    Thanks

  • Rik

    #2
    Re: Validation after form submitting..

    Advo wrote:
    Basically, im redesigning a form page on our website.
    >
    Currently the user submits the form, it does a few javascript checks
    and either submits to the "processstuff.p hp" page, or gives the user a
    JS error message.. where they have to go back and fill the details in.
    >
    Im trying to optimise and make this form/page as best as it can be.
    >
    Do you think it would be a better idea to continue using JS or use JS
    then submit to the php page(where it checks some other
    details(postcod e validation) and submits, or just solely use php
    validation?
    The best is always to do both:
    1. JS validation will inform the user instantly that something is not OK,
    and it will save him a trip to the server and back: better for the user,
    less load on the server: a win-win.
    2. JS validation can easily be bypassed or JS can be disabled by the user,
    so always, always, check again with PHP on the server itself.

    Grtz,
    --
    Rik Wasmus


    Comment

    • Gordon Burditt

      #3
      Re: Validation after form submitting..

      >Basically, im redesigning a form page on our website.
      >
      >Currently the user submits the form, it does a few javascript checks
      >and either submits to the "processstuff.p hp" page, or gives the user a
      >JS error message.. where they have to go back and fill the details in.
      Remember, spammers, bots, viruses, and other nasties tend not to
      use Javascript. And anyone can turn it off.
      >Im trying to optimise and make this form/page as best as it can be.
      >
      >Do you think it would be a better idea to continue using JS or use JS
      >then submit to the php page(where it checks some other details(postcod e
      >validation) and submits, or just solely use php validation?
      You *MUST* use php validation for security. Javascript is useful
      for excluding users who refuse to turn it on or don't know how to
      turn it on, and it can make the page a bit friendlier.


      Comment

      • NurAzije

        #4
        Re: Validation after form submitting..

        You can use AJAX with PHP, by AJAX make the php validation without
        refreshing the page, after submitting do the validation again for
        security. This is more friendly for users, and you can use php power
        all the time.. (JS have a lot of bugs, use PHP cause of that)..
        You can find a 5 minute tutorial at :


        Comment

        • Advo

          #5
          Re: Validation after form submitting..


          Gordon Burditt wrote:
          Basically, im redesigning a form page on our website.

          Currently the user submits the form, it does a few javascript checks
          and either submits to the "processstuff.p hp" page, or gives the user a
          JS error message.. where they have to go back and fill the details in.
          >
          Remember, spammers, bots, viruses, and other nasties tend not to
          use Javascript. And anyone can turn it off.
          >
          Im trying to optimise and make this form/page as best as it can be.

          Do you think it would be a better idea to continue using JS or use JS
          then submit to the php page(where it checks some other details(postcod e
          validation) and submits, or just solely use php validation?
          >
          You *MUST* use php validation for security. Javascript is useful
          for excluding users who refuse to turn it on or don't know how to
          turn it on, and it can make the page a bit friendlier.
          Yea i get what you mean and see why its needed really.

          This is how im thinking it should go in my head:

          user submits form JS checks If valid next page, if not valid go
          back(msgbox), THEN send form variables to php processing page (store as
          session) Perform php validation if false, return to the page and
          put the session variables in the form fields so they dont need to fill
          it in all again?

          That about right?

          Comment

          • Jerry Stuckle

            #6
            Re: Validation after form submitting..

            NurAzije wrote:
            You can use AJAX with PHP, by AJAX make the php validation without
            refreshing the page, after submitting do the validation again for
            security. This is more friendly for users, and you can use php power
            all the time.. (JS have a lot of bugs, use PHP cause of that)..
            You can find a 5 minute tutorial at :

            >
            And AJAX fails to call PHP validation if the user has JS disabled -
            which is a big reason for having PHP validation in the first place!

            --
            =============== ===
            Remove the "x" from my email address
            Jerry Stuckle
            JDS Computer Training Corp.
            jstucklex@attgl obal.net
            =============== ===

            Comment

            Working...