XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 9:12 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: August 29th, 2012, 4:30 am 
Offline
User avatar

Joined: August 29th, 2012, 2:34 am
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: August 29th, 2012, 6:38 pm 
Offline
User avatar

Joined: June 10th, 2012, 5:57 am
Posts: 313
Attachment:
interception.jpg
interception.jpg [ 5.55 KiB | Viewed 6052 times ]


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


Top
 Profile  
 
PostPosted: August 29th, 2012, 7:57 pm 
Offline
User avatar

Joined: August 29th, 2012, 2:34 am
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: No registered users and 17 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