Results 1 to 3 of 3

Thread: Validation

  1. #1
    Join Date
    Dec 1969

    Default Validation

    I am interested to know peoples opinions on the best way to go about<BR>validating the records (with Javascript) in a recordset before save.<BR><BR>I have two methods thast I would like opinions on in terms of efficiency.<BR><BR>Firstly, once the record set has been opened, ASP loops through the data<BR>generating the necessary validation routines with response.write.<BR><BR>Secondly, each row has a hidden field containing it&#039;s identifier. On the<BR>client, javascript loops through the forms collection finding these hidden<BR>fields and then expects that for each of the id&#039;s found there exists a<BR>number of text boxes i.e. each row might contain 2 text boxes, one whihc<BR>contains numeric data and the other to contain non numeric. The javascript<BR>can then validate the text boxes for that id (the name of the text boxes<BR>will also contain the id so that they can be identified).<BR><BR>Thanks<BR><BR>Simon<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default its apples and oranges, really

    in terms of efficiency, any time you can avoid a server round trip(s) is a good thing. That&#039;s the Javascript approach.<BR><BR>The problem with the JS approach is at least twofold:<BR>a) You have to contend with cross browser compatibility issues<BR>2) users may turn off Javascript, which in effect eliminates your validation routines<BR><BR>With ASP, you have far greater control over your validation methods (either using constraints in DB, or checking in VBScript server side), but you have to hit the server to do so, and it may make for a less intuitive user experience if for whatever reason Grandma cant figure out that her email address needs to have an @ sign or .com at the end, not grandma@aol (this has happened to me MANY times).<BR><BR>Use a judicious combination of both. Verify things like numeric/non numeric/field syntax on the client, and just to make sure, throw in a second level of error checking via ASP.

  3. #3
    Join Date
    Dec 1969

    Default RE: Validation

    Here&#039;s my preferred solution:<BR><BR><BR><BR>But, as Bill Wilkinson pointed out to me the other day, all of my &#039;chkFor&#060;Blah&#062;&#039; functions need to be re-coded because their logic is pretty crappy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts