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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rookie Question - Need to assign LEN to an object.. 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
 
First I would put a max length on the text box. You can use a regular expression validator to verify the format or range validator to designate the range allowed.

Hope everyone is having a great day!

Thanks - Jennifer
 
Jennifer can you post an short example on how to do that with ASP..thanks..
 
To set the MaxLength use:
Code:
TextBox1.MaxLength = 10
As for the actual data, you could use a Regular Expression (as already suggested) or use a RangeValidator control.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
thank you ca8 and jennifer i just realized that I posted in the wrong BLOG..i am coding in ASP...so I appreciate your help none the less..that is probably why i was confused with your responses...thanks anyways...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top