1. Senior Member
Join Date
Dec 1969
Posts
199

hi all,<BR> I have a form where user will be writing some number to text<BR>field .the user has to enter the number in a specific format like 100,000.if he is making a mistake in puting the coma in the right place,he should be alerted.how do i keep track of the coma&#039s.if he enters 21,00 he should be alerted that he should put like 2,100 .<BR>Thanks in advance<BR>

2. Salim Guest

I would take two textboxes and check the lenght of the second one with Len(yourstring). But I m not a professional, so check for better answers.<BR><BR>Good luck

3. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## Why do you want to do that

I cant understand why you would want to do that. Just save it normally in the DB as an integer or number(x) and when you display it on the screen just use the FormatNumber function and all your problems would be solved.<BR><BR>If you have to do that the yo will have to go through the string and check for the "," and....UGH....i would not suggest it.

4. BalletChick Guest

5. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## Isnumeric()????

How will that ensure the , are in the right place??

6. BalletChick Guest

## RE: Isnumeric()????

It won&#039t.... I had a mind fart. I should just go and RTFM! :)<BR><BR>Well, I can think of another way, but it sure seem inelegant to me... it would involve doing a split on the commas, then checking the members to see if any are over three digits, plus checking to see if any other than the first and last are UNDER three digits, then checking the last member for a decimal point and seeing if it follows the correct rules.<BR><BR>Yikes!<BR><BR>OK... here&#039s a less cheesy way...<BR><BR>if instr(a, ",") then<BR> if formatnumber(a,,,,True) = a then response.write "VALID"<BR>end if

7. Senior Member
Join Date
Dec 1969
Posts
199

## thanks ballet chick but can i do that format che

thanks ballet chick<BR>but how it can be done in the front end validation

8. BalletChick Guest

## RE: thanks ballet chick but can i do that format

(sigh)<BR><BR>If only people would spell out all of the requirements before I begin... ahhh well...<BR><BR>You could use this regexp string, which works with currency OR non-currency numbers (i.e. leading \$ sign or not). It insures that commas are in the right place and decimal places are two or less)... does that help?<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;/^\$?((d{1,3}(,d{3})*)&#124d+)(.dd)?\$/ <BR><BR>

9. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## RTFM???

What does RTFM stand for??

10. BalletChick Guest

## RE: RTFM???

It&#039s an ancient (&#062; 20 year) computer acronym for &#039Read the f***ing manual"

#### Posting Permissions

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