In my web page input forms I've been using field names like "radius:int" so Zope will coerce variables to the proper type. This works fine on the server. Unfortunately, if I have a JavaScript function on my web page to do form input validation, how do I reference that object? Is there some alternate naming scheme that will allow Zope to do the type cast and allow references from JavaScript? Should I just forego the :int stuff altogether and do the coercion explicitly? Thx, -- Skip Montanaro | http://www.mojam.com/ skip@mojam.com | http://www.musi-cal.com/
Skip Montanaro wrote:
In my web page input forms I've been using field names like "radius:int" so Zope will coerce variables to the proper type. This works fine on the server. Unfortunately, if I have a JavaScript function on my web page to do form input validation, how do I reference that object? Is there some alternate naming scheme that will allow Zope to do the type cast and allow references from JavaScript? Should I just forego the :int stuff altogether and do the coercion explicitly?
In your JavaScript functions, reference the variable as such: forms[0].elements["radius:int"] (Replace the "0" with an actual name if you've named your form . . .) -CJ
participants (2)
-
Christopher J. Kucera -
Skip Montanaro