Validation & redirect in asp page

I need to make an asp page that validates input the user submitted via a search page..Then it checks the database to determine if the search returns any result & redirect it to a search results page(if there is any result otherwise return to the search page)

the validation rules for the inputs are:
*If customer last name, the submitted text box value must be a string value which contains only alphabetic characters & no spaces
*if customer number, the text box value must be a numeric value betweem 100000 and 999999 inclusive
*if by order number , the text box value nmust be a string value of seven characters with the first character being alphabetic and the remaining six being numeric digits.

if the validation identifies a problem then the page must redirect to the search page, if there is no problem then an appropiate query is to be used to check the database. if there are no orders then it should againa redirect to the search page. if there are results then redirect to another page to show the results..

Can anyone help? Thanks
[1082 byte] By [shipwreck99] at [2007-11-20 11:33:02]
# 1 Re: Validation & redirect in asp page
http://www.google.com/search?source=ig&hl=en&rlz=&q=asp+validation&btnG=Google+Search
http://www.google.com/search?hl=en&q=asp+redirect&btnG=Search
PeejAvery at 2007-11-9 11:54:01 >
# 2 Re: Validation & redirect in asp page
i can't figure out which one will work with my website. As i've to use vbscript for the validation not asp validation. The thing i'm stuck on is when the user selects the basis of his search in the form only that textbox needs to be validated. the others doesn't have any value in it. This is my form:

<script type="text/javascript">
var currentEnabled = null;
function enableElement(elem) {
if (currentEnabled) {
currentEnabled.disabled = true;
}
elem.disabled = false;
currentEnabled = elem;
}
</script>
<input type="text" name="custID" disabled="disabled">Customer ID
<input type="radio" name="cell" value="1"
onclick="enableElement(this.form.elements['custID']);">
<br/><br/>
<input type="text" name="lname" disabled="disabled">Customer Last Name
<input type="radio" name="cell" value="2"
onclick="enableElement(this.form.elements['lname']);">
<br/><br/>
<input type="text" name="ordernumber" disabled="disabled">Customer Order Number
<input type="radio" name="cell" value="3"
onclick="enableElement(this.form.elements['ordernumber']);"><br/><br/>
<input type = "submit" value = "Search"/> <input type ="reset"/>
</form>

so the validation rules should apply to the one option the user choses in here. The form is working as i'm getting the values posted to the asp page. But i'm not sure how to do the vbscript validation & redirect them to other pages..
shipwreck99 at 2007-11-9 11:55:01 >
# 3 Re: Validation & redirect in asp page
But i'm not sure how to do the vbscript validation & redirect them to other pages..
I just posted two links that are full of great sources for you. Also, if you don't want asp validation, search Google for "vbscript validation." Remember that you want server-side validation, not client-side. VBScript on the client side will only work in IE, and will not be as secure.
PeejAvery at 2007-11-9 11:56:10 >