Don't check, just add those characters server-side ...
strCC = "%" & Request.Item("fieldName").ToString.Trim & "^"
hth,
tom mallard
.net web applications
consumer product design
_____
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of
Rick
Sent: Friday, April 13, 2007 9:21 AM
To: [email protected]
Subject: [AspNet2] Credit Card Swipe
Hello, I have a text box that has code in it that checks to make sure
the first char is a '%' and the last is a '^' because that is how our
CC's work. However, if I want someone to be able to type into it,
they have to type a % first and the a carrot at the end. Is there
anyway to avoid that...here is the code...I didn't write it, butit is
how the boss wants it:
if (e.KeyChar == '^')
IsSwipeStarted = false;
if (IsSwipeStarted)
{
if (char.IsNumber(e.KeyChar) == false)
e.Handled = true;
}
else
e.Handled = true;
if (e.KeyChar == '%')
IsSwipeStarted = true;
if (e.KeyChar == '\r')
btnCardParse_Click(null, null);
TIA:
Rick
[Non-text portions of this message have been removed]