This is a migrated thread and some comments may be shown as answers.

Radtextbox limit to one word?

2 Answers 65 Views
Input
This is a migrated thread and some comments may be shown as answers.
Alan T
Top achievements
Rank 1
Alan T asked on 21 Jul 2011, 04:43 PM
Hi there,

is it possible using either radtextbox, or radmaskedtextbox to limit the input to only one word ?

Regards,

Alan

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 25 Jul 2011, 12:03 PM
Hello Alan,

You can achieve this by attaching ClientEvent OnKeyPress to the RadTextBox. Here is the sample code that I tried which worked as expected.

Javascript:
<script type="text/javascript">
  function OnKeyPress(sender,args)
{
  var c=args.get_keyCode();
  if (c==32)
  {
  args.set_cancel(true);
  }
 }
</script>

Thanks,
Shinu
0
Alan T
Top achievements
Rank 1
answered on 25 Jul 2011, 11:50 PM
thankyou for the response Shinu. great forum.
Tags
Input
Asked by
Alan T
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Alan T
Top achievements
Rank 1
Share this question
or