Hi, How can I force a field to just have a value type? Example: the name field will just receive letters, it can'r receive numbers. Can anyone tell me how can I do this? Another thing. Do anyone knows where I can get information about Tiny Tables? I already searched in www.zope.org, www.egroups.com, and www.google.com, but I couldn't get anything. Please send you answers to: psilva@ruido-visual.pt Thanks, Pedro
This javascript code can be used on your client to strip out unwanted characters from a field. To use you would add - onChange="this.value=JRestrict(this.value)" - into your HTML <input> tag The function would go in the HEAD of the HTML document. function JRestrict(fldVal) { var charsToAllow='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz '; var fldVal2=''; for (i=0 ; i < fldVal.length ; i+=1) { if (charsToAllow.indexOf(fldVal.charAt(i))!=-1) { fldVal2+=fldVal.charAt(i) } } return fldVal2; } ----- Original Message ----- From: Pedro Silva <psilva@ruido-visual.pt> To: Zope - Questions <zope@zope.org> Sent: Friday, February 18, 2000 11:21 AM Subject: [Zope] Forcing Hi, How can I force a field to just have a value type? Example: the name field will just receive letters, it can'r receive numbers. Can anyone tell me how can I do this? Another thing. Do anyone knows where I can get information about Tiny Tables? I already searched in www.zope.org, www.egroups.com, and www.google.com, but I couldn't get anything. Please send you answers to: psilva@ruido-visual.pt Thanks, Pedro _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
You might want to think about this before implementing it -- remember that trusting your clients is a _bad_ thing since you have no way to see if they client has obeyed your actions. All they would have to do to avoid this is have javascript turned off on their browser or have a browser that doesn't support JS. -- Roddy On Fri, 18 Feb 2000, Jim Sanford wrote: => This javascript code can be used on your client to strip out unwanted characters from a field. => To use you would add - onChange="this.value=JRestrict(this.value)" - into your HTML <input> tag => The function would go in the HEAD of the HTML document. => => => function JRestrict(fldVal) { => var charsToAllow='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz '; => var fldVal2=''; => for (i=0 ; i < fldVal.length ; i+=1) { => if (charsToAllow.indexOf(fldVal.charAt(i))!=-1) { => fldVal2+=fldVal.charAt(i) => } => } => return fldVal2; => } => => => ----- Original Message ----- => From: Pedro Silva <psilva@ruido-visual.pt> => To: Zope - Questions <zope@zope.org> => Sent: Friday, February 18, 2000 11:21 AM => Subject: [Zope] Forcing => => => Hi, => => How can I force a field to just have a value type? Example: the name field => will just receive letters, it can'r receive numbers. => Can anyone tell me how can I do this? => => Another thing. Do anyone knows where I can get information about Tiny => Tables? I already searched in www.zope.org, www.egroups.com, and => www.google.com, but I couldn't get anything. => => Please send you answers to: psilva@ruido-visual.pt => => Thanks, => => Pedro => => => _______________________________________________ => Zope maillist - Zope@zope.org => http://lists.zope.org/mailman/listinfo/zope => ** No cross posts or HTML encoding! ** => (Related lists - => http://lists.zope.org/mailman/listinfo/zope-announce => http://lists.zope.org/mailman/listinfo/zope-dev ) => => => => => _______________________________________________ => Zope maillist - Zope@zope.org => http://lists.zope.org/mailman/listinfo/zope => ** No cross posts or HTML encoding! ** => (Related lists - => http://lists.zope.org/mailman/listinfo/zope-announce => http://lists.zope.org/mailman/listinfo/zope-dev ) => => --- Roddy Vagg Programmer, Web Developer Cooperative Research Centre for Cattle and Beef Quality (and) Total Genetic Resource Management (TGRM) Ph: (+61)267733978 ---
participants (3)
-
Jim Sanford -
Pedro Silva -
Roddy