RadTextbox

2 posts, 0 answers
  1. Tina
    Tina avatar
    130 posts
    Member since:
    Jul 2011

    Posted 23 Aug 2011 Link to this post

    Hello,

    Can i enter only one word in radtextbox?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 24 Aug 2011 Link to this post

    Hello Tina,

    You can achieve this by attaching the Client event OnKeyPress as shown below.
    aspx:
    <telerik:RadTextBox ID="radTextBox" runat="server" TextMode="MultiLine" >
            <ClientEvents OnKeyPress="OnKeyPress"/>
    </telerik:RadTextBox>

    Javascript:
    function OnKeyPress(sender,args)
    {
       var c=args.get_keyCode();
      if (c==32)
      {
       args.set_cancel(true);
      }
    }

    Thanks,
    Princy.
Back to Top