Maybe I over-complicated my original request. I have a form field that is a list: ['2 DR CONVERTIBLE','2 DR COUPE','2 DR HATCHBACK'] The URL looks like this: vehicleList?bt=2+DR+CONVERTIBLE&bt=2+DR+COUPE&bt=2+DR+HATCHBACK When I pick for years 2002 and 2001 for the above body types, the URL changes a bit: vehicleList?yr%3Alist=2002&yr%3Alist=2001&bt%3Alist=%5B%272+DR+CONVERTIBLE%2 7%2C+%272+DR+COUPE%27%2C+%272+DR+HATCHBACK%27%5D
From this search, I get no results. If I manually take out the %5B and %3A etc. codes it works fine.
How do I keep the above conversion from happening? Thanks again! -Allen
[Schmidt, Allen J.]
Maybe I over-complicated my original request.
I have a form field that is a list: ['2 DR CONVERTIBLE','2 DR COUPE','2 DR HATCHBACK']
The URL looks like this: vehicleList?bt=2+DR+CONVERTIBLE&bt=2+DR+COUPE&bt=2+DR+HATCHBACK
When I pick for years 2002 and 2001 for the above body types, the URL changes a bit:
vehicleList?yr%3Alist=2002&yr%3Alist=2001&bt%3Alist=%5B%272+DR+CONVERTIBLE%2
7%2C+%272+DR+COUPE%27%2C+%272+DR+HATCHBACK%27%5D
From this search, I get no results. If I manually take out the %5B and %3A etc. codes it works fine.
How do I keep the above conversion from happening?
You can't -it's called URL encoding and happens at the browser - but just get the properties from the REQUEST, instead of from the url, then they will be nice python-compatible lists. Zope handles the URL decoding for you automatically (it will do it for either POST or GET forms). For example REQUEST.yr would return ['2002','2001'] Cheers, Tom P
Schmidt, Allen J. writes:
Maybe I over-complicated my original request.
I have a form field that is a list: ['2 DR CONVERTIBLE','2 DR COUPE','2 DR HATCHBACK']
The URL looks like this: vehicleList?bt=2+DR+CONVERTIBLE&bt=2+DR+COUPE&bt=2+DR+HATCHBACK
When I pick for years 2002 and 2001 for the above body types, the URL changes a bit: vehicleList?yr%3Alist=2002&yr%3Alist=2001&bt%3Alist=%5B%272+DR+CONVERTIBLE%2 7%2C+%272+DR+COUPE%27%2C+%272+DR+HATCHBACK%27%5D This looks as if you would have your list in a hidden variable of the form
<input name="bt:list" type="hidden" value="&dtml-bt;"> When this arrives at the Zope server, you will get a list with one string that respresents the former list as a string. You need instead: <dtml-in br> <input name="bt:list" type="hidden" value="&dtml-sequence-item;"> </dtml-else> <input name="bt:tokens" type="hidden" value=""> </dtml-in> i.e. each list element must gets its one "input" control. Dieter
participants (3)
-
Dieter Maurer -
Schmidt, Allen J. -
Thomas B. Passin