[Zope] Forcing

Jim Sanford jsanford@atinucleus.com
Fri, 18 Feb 2000 12:41:27 -0600


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 )