Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some help validating the LEN on a Text Box 1

Status
Not open for further replies.

1Data

MIS
Sep 30, 2005
66
US
I need to assign a length of an Text box to an object for validation purposes. I know this is not that hard but I have had a long weekend and can't think today...thanks for any suggestions...

dim intcheck

If Form.purchaseprice1.value = "" then
'Elseif Form.purchaseprice1.value
MsgBox "Please Enter a valid Purchase Price. No $ or - (XXXX.XX)"
Form.purchaseprice1.focus()
Exit Sub
Else Len(Form.purchaseprice1.value) > 11
document.write Len(Form.purchaseprice1.value)
intcheck = = Len(Form.purchaseprice1.value)
'MsgBox "Please Enter a valid Purchase Price. Can only be 11 numbered digits long."
Form.purchaseprice1.focus()
Exit Sub

This is what I have so far...again thanks
 
If it is just a one line text box in the form you can use maxlength.

<form method="POST" action="whatever.asp">
<p><input type="text" name="PurchasePrice" size="20" maxlength="11"><input type="submit" value="Go" p>
</form>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top