For Q 2:
You can use the following javascript
:
function nb_numeralsOnly(evt)
{
evt = (evt) ? evt : event;
var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode
: ((evt.which) ? evt.which : 0));
if (charCode > 31 && (charCode < 48 || charCode >57)) {return false;}
return true;
}
and bind :
onkeypress='return nb_numeralsOnly(event);'
for Question 1 you could use:
function setUpper(evt)
{
evt = (evt) ? evt : event;
var kc = evt.keyCode;
if (kc>96 && kc<123)
{
evt.keyCode=kc-32;
}
return true;
}
This will still allow other characters but translates lower case
non-accented latin characters to upper case while typing.
bind in the same way as above.
onkeypress='return setUpper(event);'
Dan
"LAL" <> wrote in message
news:...
> Greetings...
>
> So what you're saying is, "It can't be done." *deep sigh* It sounded
like
> such an easy request. Oh well.
>
> LAL
> "Seb" <> wrote in message
> news:eo1Ob.11479$ link.net...
> > This cannot be done on a webpage regardless of ASP.NET. The client side
of
> a
> > web page is automated by javascript. The onChange event will fire in
> > Javascript as the user selects, clicks, or tabs to a control other than
> your
> > textbox. This is when the event will fire and when you can change the
> case
> > of your textbox.
> >
> > "LAL" <> wrote in message
> > news:#...
> > > Greetings...
> > >
> > > I'm pretty new to ASP.NET programming and I have two questions:
> > >
> > > 1. How can I automatically change what it typed into a text box to
upper
> > > case as the user is typing on the webpage?
> > >
> > > I tried the following suggestion
> > > http://www.dotnet247.com/247referenc...33/166114.aspx
> > > (Basically add a script to call .ToUpperCase on the value of control
> > passed
> > > in, the call this script in onKeyUp event)
> > > but onKeyUp doesn't appear to be a recognized event on the TextBox
> > control.
> > >
> > > 2. Is there a way to limit what the user types to be numeric
characters
> > > only? In other word, 1234567890 would be the only accepted
characters?
> > >
> > > Thanx!
> > > LAL
> > >
> > >
> >
> >
>
>