default values in forms
hi there, i'd like to send default values for an data update with the link to the form like <a href="adr_change_frm?f_id=<dtml-var id>&f_name=<dtml-var name>">c</a> unfortunately name may contain spaces. i found out that spaces may be replaced by "+" in the link, but how do i get the "+" into the <dtml-var ...> statement? thanks for help olaf -- soli-con Engineering Zanger Dipl.-Ing. (FH) Olaf Zanger Nusch Lorrainestrasse 23 3013 Bern / Switzerland Fon: +41-31-332 9782 Mob: +41-76-572 9782 mailto:info@soli-con.com mailto:olaf.zanger@soli-con.com http://www.soli-con.com
An ugly solution is <a href="adr_change_frm?f_id=<dtml-var "_.string.replace(id, ' ', '+'">&f_name=<dtml-var "_.string.replace(name, ' ', '+')">">c</a> Be careful that other none url compliant characters dont slip into your variables. -- Andy McKay, Developer. ActiveState. ----- Original Message ----- From: "Olaf Zanger" <olaf.zanger@soli-con.com> To: "Zope Mailinglist" <zope@zope.org> Sent: Wednesday, December 13, 2000 6:55 AM Subject: [Zope] default values in forms
hi there,
i'd like to send default values for an data update with the link to the form
like <a href="adr_change_frm?f_id=<dtml-var id>&f_name=<dtml-var name>">c</a>
unfortunately name may contain spaces.
i found out that spaces may be replaced by "+" in the link, but how do i get the "+" into the <dtml-var ...> statement?
thanks for help
olaf
-- soli-con Engineering Zanger Dipl.-Ing. (FH) Olaf Zanger Nusch Lorrainestrasse 23 3013 Bern / Switzerland Fon: +41-31-332 9782 Mob: +41-76-572 9782 mailto:info@soli-con.com mailto:olaf.zanger@soli-con.com http://www.soli-con.com
On Wed, 13 Dec 2000, Olaf Zanger wrote:
i found out that spaces may be replaced by "+" in the link, but how do i get the "+" into the <dtml-var ...> statement?
what you want is <dtml-var blah url_quote> see the DTML guide: http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.5.html HTH Stefan
Oops forgot about that. Yep use that. That's it I'll stop answering questions until at least 3 cups of tea in the morning. -- Andy McKay, Developer. ActiveState. ----- Original Message ----- From: "Stefan H. Holek" <stefan@epy.co.at> To: "Olaf Zanger" <olaf.zanger@soli-con.com> Cc: "Zope Mailinglist" <zope@zope.org> Sent: Wednesday, December 13, 2000 9:04 AM Subject: Re: [Zope] default values in forms
On Wed, 13 Dec 2000, Olaf Zanger wrote:
i found out that spaces may be replaced by "+" in the link, but how do i get the "+" into the <dtml-var ...> statement?
what you want is <dtml-var blah url_quote>
see the DTML guide: http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.5.html
HTH Stefan
_______________________________________________ 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 )
Olaf Zanger wrote:
hi there,
i'd like to send default values for an data update with the link to the form
like <a href="adr_change_frm?f_id=<dtml-var id>&f_name=<dtml-var name>">c</a>
unfortunately name may contain spaces.
i found out that spaces may be replaced by "+" in the link, but how do i get the "+" into the <dtml-var ...> statement?
Try <a href="adr_change_frm?f_id=<dtml-var id>&f_name=<dtml-var name fmt=url_quote>">c</a> Ivan
On Thursday 14 December 2000 04:52, Ivan Cornell wrote:
Olaf Zanger wrote:
hi there,
i'd like to send default values for an data update with the link to the form
like <a href="adr_change_frm?f_id=<dtml-var id>&f_name=<dtml-var name>">c</a>
unfortunately name may contain spaces.
i found out that spaces may be replaced by "+" in the link, but how do i get the "+" into the <dtml-var ...> statement?
Try <a href="adr_change_frm?f_id=<dtml-var id>&f_name=<dtml-var name fmt=url_quote>">c</a>
I don't know about you, but this looks messy.... Yes, It will work, but... <a href="<dtml-var " 'adr_change_frm?f_id=%s&f_name=%s' % ( id, name ) " fmt=url_quote>c</a> at least, to me, is a fair bit clearer.... However, the url_quote might not like & or ?... but I'm sure this is working in one of my sites currently.
Ivan
Curtis.
<snip>
i found out that spaces may be replaced by "+" in the link, but how do i get the "+" into the <dtml-var ...> statement?
<dtml-var something url_quote_plus> Can't honestly remember where the word "plus" is supposed to be, but search the DTML Reference documentation.
thanks for help
olaf
-- soli-con Engineering Zanger Dipl.-Ing. (FH) Olaf Zanger Nusch Lorrainestrasse 23 3013 Bern / Switzerland Fon: +41-31-332 9782 Mob: +41-76-572 9782 mailto:info@soli-con.com mailto:olaf.zanger@soli-con.com http://www.soli-con.com
participants (6)
-
Andy McKay -
Curtis Maloney -
Ivan Cornell -
Olaf Zanger -
peter bengtson -
Stefan H. Holek