Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

specifying input into entry field

Status
Not open for further replies.

MZimmerman6

Programmer
Jun 21, 2010
5
US
I was wondering if there is an easy way to specify what can be entered into an entry widget. Basically meaning that if an entry is meant to accept only numbers, when a user goes to enter text/letters into the box, it will not allow then to do so. Thanks for your help in advance!
 
nevermind, I did a little bit of searching on this one and the concept is not too bad at all. I though I had tried the validate command before and did not get it to work, but it is now.

basically what you can do if anyone else looks at this is set up your entry field like as follows

entry .integerInput -validate key -vcmd {string is integer %P}

This will check to see if the input follows the rules of what TCL defines as an integer, if not, it does not allow the input into the field. by using the "key" parameter, this checks the box every time it is editted. so yeah.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top