1 Reply Latest reply: Aug 7, 2012 9:47 AM by Steve Sommers RSS

    CFSelect not holding value on error

    userCold9 Community Member

      Hi,

       

      When a page is submitted for validation, the value on the submitted page will not contain the value entered after the browser back button from the error page is selected.

       

      When there is an error with the entry, another screen is displayed with the error message.

       

      Is there any way of displaying the submitted value using the browser back button?

       

      The input field is using the CFINPUT.

       

       

      Mike

        • 1. Re: CFSelect not holding value on error
          Steve Sommers Community Member

          I include client side validation just because of issues like this. What the back button does as far as how form fields are preserved or not preserved is dependent on the browser; you really don't have much control at this level. If you only want to use server side validation, I wrote and article several years back that still applies: Form Validation and Flow - One Technique. In a nutshell, validate the data, display any error messages and redisplay the form, prepopulated with the posted data for fixing by the user.

           

          Just to clarify, with my first suggestion (client side validation), I'm not advocating switching from server side to client side validation. Instead I'm recommending adding client side validation. You always need server side validation to prevent hacking, but client side makes for a more user friendly application.