Data validation-ASP-DB

Results 1 to 4 of 4

Thread: Data validation-ASP-DB

  1. #1
    Sherri Guest

    Default Data validation-ASP-DB

    I&#039m looking for some pointers on how to validate data on an ASP that is connected to a database. The ASP has a recordset for the tblOrders and contains textbox that are the fields in the table. I&#039d like to add an include file that contains some validation functions for dates, zips, phone numbers and to make sure required fields are not null. If the fields are not populated correctly, I&#039d like to display a message to the client otherwise update the record. I&#039m currently using VisualInterDev since this is my first approach to creating a web based front end. I&#039m looking for some code examples or someone to point me in the correct direction.<BR>

  2. #2
    Corin Guest

    Default here's a start

    Once you have the RecordSet filled just check for a null value<BR><BR>IF rs.fields("recordtocheck") = "" Then<BR><BR>response.redirect "your update page"<BR><BR>End If<BR><BR>

  3. #3
    toby_2 Guest

    Default ..not much of a start

    JavaScript is great for client side form validation.<BR>Best to learn this by looking at others code. View the source of a page that interests, or i can email you a sample.<BR><BR>On the server side you can check the data type that the user input.<BR>eg. <BR>isDate(value) will return to true for a valid date<BR>isNumeric(value) - for numbers, e.g. us zip code / phone<BR><BR>also look for &#039illegal&#039 characters that might screw with your database e.g &#039 or %20, etc.<BR>look for these with inStr() or Replace or RegExp, etc..

  4. #4
    Sherri Guest

    Default RE: ..not much of a start

    I would really appreciate a sample of code emailed if you don&#039t mind to:

Posting Permissions

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