REVO2700AllowedCharsBehavior3H`~NAllowed Chars Behavior UComic Sans MSUComic Sans MS WLucida Sans Typewriter ULucida GrandeUApple Braille Pinpoint 6 Dot UApple Braille Pinpoint 6 Dot U Comic Sans UComic Sans MSU Helvetica U Helvetica cRevOnlineid318 cREVGeneralbreakpointconditions breakpointsbreakpointstatesstackfileversion2.7 cGlx2Generalid 1246302462078 @N AllowedCharsLabel JB cREVTable currentviewEntry cREVGeneral revUniqueID 1246302500100 Entry Entry)h@@cAllowedChars 1234567890.cEntry 123.45656"Field accepts only allowed chars.&AllowedCharsBehavior cREVGeneral revUniqueID 1246302685319scripteditorvscroll0  123.456 AllowedChars Input Label  cREVTable currentview AllowedChars: cREVGeneral revUniqueID 1246302779080 AllowedChars:  AllowedChars)`'Comma-separated list of allowed chars. cREVGeneral revUniqueID 1246302869654  1234567890.Setewon mouseUp set the cEntry of fld "Entry" to empty put empty into fld "Entry" set the cAllowedChars of fld "Entry" to fld "AllowedChars" answer "Allowed chars of field 'Entry' set to " & quote & fld "AllowedChars" & quote end mouseUp ^*4Set cREVGeneralscripteditorvscroll0 revUniqueID 1246302893564 AllowedCharsBehaviorE--> all handlers on returnInField beep end returnInField on keydown tKey if tKey is not in the cAllowedChars of me then beep exit keyDown end if put word 2 of the selectedchunk of me into tSChar put word 4 of the selectedchunk of me into tEChar put the cEntry of me into tEntry if tEChar > tSChar then -- some text is selected delete char tSChar to tEChar of me delete char tSChar to tEChar of tEntry end if put word 2 of the selectedchunk of me into tSChar put word 4 of the selectedchunk of me into tEChar put tKey after char tEChar of tEntry set the cEntry of me to tEntry put tKey after char tEChar of me end keyDown on backspaceKey put word 2 of the selectedchunk of me into tSChar put word 4 of the selectedchunk of me into tEChar put the cEntry of me into tEntry if tEChar > tSChar then -- text is selected delete char tSChar to tEChar of me delete char tSChar to tEChar of tEntry else delete char tEChar of me delete char tEChar of tEntry end if set the cEntry of me to tEntry end backspaceKey on deleteKey put word 2 of the selectedchunk of me into tSChar put word 4 of the selectedchunk of me into tEChar put the cEntry of me into tEntry if tEChar > tSChar then -- text is selected delete char tSChar to tEChar of me delete char tSChar to tEChar of tEntry else delete char tSChar of me delete char tSChar of tEntry end if set the cEntry of me to tEntry end deleteKey -- thanks to "SparkOut" on pasteKey if the clipboardData["text"] is not empty then set the clipboardData["text"] to replaceText(the clipboardData["text"],"[^"& the cAllowedChars of me & "]",empty) paste end if end pasteKey %" cGlx2GeneralcScriptChecksumcExplicitVariablescHscrollScript0cLocalscHscrollHandlers0cSelectedChunkchar 696 to 695 cHtmlScriptbSn02T#Emt8 c#|( )K='{tBk([$@7i/o XQ[Sv`pZ ʷRX#MuFl^1ӻg E4m\l+v1#Yٙ*b+CtӮ+L4ަ2Z` MY~&^ WJ_ :bcOZ}u4_J99a'ጦSE4/ο2 &/+Ї#{Ya&Y6&??IrVf}jP٦9!~F'^fslxZE=cmCG䶝?~ F̶cHandlersListWidth127 cConstantscHtmlHandlers)I). EɶJƆƖJv6 qĜļԢb}B;.;5eKk4f&pIɩީJII-!MKvjeJ~y R2SsR@ZJB cDirtyFlagfalse cFolders all handlers cHandlers(backspaceKey deleteKey keydown openFieldcVscrollScript0cVscrollHandlers0 cHilitedLine cGlobalscGlx2TimeStamp 1244114159end checksum/&ȁM 1244113955start 1244109663working 1244149094start 1244109486start cREVGeneralscripteditorvscroll456 revUniqueID 1246303245918 Info  cREVTable currentview

The field "Entry" in this stack accepts only the characters in its cAllowedChars custom property. The "AllowedCharsBehavior" button provides the necessary behavior (adapted from Devin Asay's Password Field behavior). To try out the behavior, type the allowed chars in the "AllowedChars" field and click the Set button. (The cAllowedChars is NOT a list of items, just a set of characters, so that any characters -- including commas or other delimiters -- can be allowed.)

To use the field, copy it and the "AllowedCharsBehavior" button to your stack. (You may change the field's name.) Set the behavior of the field to the button's id. Set the cAllowedChars custom property by script or using the Property Inspector.

 cREVGeneral revUniqueID 1246303722161 The field "Entry" in this stack accepts only the characters in its cAllowedChars custom property. The "AllowedCharsBehavior" button provides the necessary behavior (adapted from Devin Asay's Password Field behavior). To try out the behavior, type the allowed chars in the "AllowedChars" field and click the Set button. (The cAllowedChars is NOT a list of items, just a set of characters, so that any characters -- including commas or other delimiters -- can be allowed.) To use the field, copy it and the "AllowedCharsBehavior" button to your stack. (You may change the field's name.) Set the behavior of the field to the button's id. Set the cAllowedChars custom property by script or using the Property Inspector. BackgroundK@R!0 cREVGeneral revUniqueID 1246304196309 revOnline | RunRev