XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently 2017年 Oct 20日 02:42

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2012年 Aug 29日 04:30 
Offline
User avatar

Joined: 2012年 Aug 29日 02:34
Posts: 56
The following function restricts the amount of the characters in the inputBox / textField AKA [Edit] to "N" characters maximum. The characters which will be entered in the Edit after the limit - will be deleted automatically.

The function:
Code:
function limitInputTo3Chars(Sender,Key,KeyChar,Shift)
{
         var n = 3
         if (Sender.Text.length > n)
         {
            Sender.Text = Sender.Text.substring(0, n);
         }
}

Add the function name to the textBoxes' "OnKeyUp" event

_________________
Image


Top
 Profile  
 
PostPosted: 2012年 Aug 29日 18:38 
Offline
User avatar

Joined: 2012年 Jun 10日 05:57
Posts: 315
Attachment:
interception.jpg
interception.jpg [ 5.55 KiB | Viewed 3289 times ]


the interception function of the text control has the same effect.


Top
 Profile  
 
PostPosted: 2012年 Aug 29日 19:57 
Offline
User avatar

Joined: 2012年 Aug 29日 02:34
Posts: 56
qiancang wrote:
Attachment:
interception.jpg


the interception function of the text control has the same effect.


Took me a while to find it, thanks man! :D

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group