thanks for tal:atrributes problem
Danke Jürgen, Thanks it did work.I guess i've to keep python handy always. one tip i'm lookin for is how to cal pyhton scripts on any form event, ie. like we call javascripts on the onclick or onsubmit or onchange events? thanks again. On Wed, 23 Mar 2005 Jürgen Herrmann wrote :
try something like this:
<option tal:content="district/district_name" tal:attributes="selected python:test(distname==district.district_name, 'selected', '')"></option>
regards, juergen herrmann
[ prabuddha ray wrote:]
sir, i guess i'm not gettin it. kindly tell me the syntax. wats happeneing is dat its setting the last item as selected. where as i want the item matching the result from 'distname' var sud be selected only. kindly gimme the syntax if possible.
On 29 Mar 2005 05:39:42 -0000, prabuddha ray <buddha_2001@rediffmail.com> wrote:
Thanks it did work.I guess i've to keep python handy always. one tip i'm lookin for is how to cal pyhton scripts on any form event, ie. like we call javascripts on the onclick or onsubmit or onchange events? thanks again.
The only way to call python scripts from a browser is to make a HTTP request. So I think you may have to give an example of what you want to do. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
On 29.Mär 2005 - 05:39:42, prabuddha ray wrote:
Danke Jürgen, one tip i'm lookin for is how to cal pyhton scripts on any form event, ie. like we call javascripts on the onclick or onsubmit or onchange events? thanks again.
You can't. Python and JavaScript are completely different things. JavaScript runs on the client side, whereas Python runs on the server. However, you probably can use your JavaScript to call a python Script, but I wouldn't suspect that it works the same as with JavaScript alone. Python Scripts are executed when you send them a Request or by calling them from within another python script (or TAL or DTML statement) Andreas -- You have an ambitious nature and may make a name for yourself.
for lennart n anrdeas, sir, i had built this page in asp earlier n now need to create a zpt ver. d javascript function used for submit is below: function sub_click(){ document.nlogin.login.value='y' // 'login' is flag for valid login n not bein used in zpt till now. document.nlogin.action='c_nlogged' // 'c_nlooged' the python script meant to handle the pwd validation n redirection to next page or bact to the current page. document.nlogin.method='post' document.nlogin.submit() } <input title="Click to Go" name="subm" type="submit" value="Go" style="color:blue" onsubmit="sub_click()"> below is python script c_nlogged: request = container.REQUEST RESP = request.RESPONSE passwd = request.password1 user = request.username, if container.chkpwd(uname=user,pwd=passwd): //getting sysntax error here. RESP.redirect(/store_nic/consumables/c_menu) else: RESP.redirect(/store_nic/consumables/index_html) below is zsql method chkpwd : select distinct(password) from c_userdet where username=<dtml-sqlvar uname type="string"> and password=<dtml-sqlvar pwd type="string"> i wanted to avoid d middle python script n handle the pwd validation in the same zpt . is it possible. i have carry req vars eg. username pwd ,districtname in session for future use. plz giv soln . On Tue, 29 Mar 2005 19:07:00 +0200, Andreas Pakulat <apaku@gmx.de> wrote:
On 29.Mär 2005 - 05:39:42, prabuddha ray wrote:
Danke Jürgen, one tip i'm lookin for is how to cal pyhton scripts on any form event, ie. like we call javascripts on the onclick or onsubmit or onchange events? thanks again.
You can't. Python and JavaScript are completely different things. JavaScript runs on the client side, whereas Python runs on the server. However, you probably can use your JavaScript to call a python Script, but I wouldn't suspect that it works the same as with JavaScript alone. Python Scripts are executed when you send them a Request or by calling them from within another python script (or TAL or DTML statement)
Andreas
-- You have an ambitious nature and may make a name for yourself. _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- Share the vision of difference with ME
for lennart n anrdeas, sir, i had built this page in asp earlier n now need to create a zpt ver. d javascript function used for submit is below: function sub_click(){ document.nlogin.login.value='y' // 'login' is flag for valid login n not bein used in zpt till now. document.nlogin.action='c_nlogged' // 'c_nlooged' the python script meant to handle the pwd validation n redirection to next page or bact to the current page. document.nlogin.method='post' document.nlogin.submit() } <input title="Click to Go" name="subm" type="submit" value="Go" style="color:blue" onsubmit="sub_click()"> below is python script c_nlogged: request = container.REQUEST RESP = request.RESPONSE passwd = request.password1 user = request.username, if container.chkpwd(uname=user,pwd=passwd): //getting sysntax error here. RESP.redirect(/store_nic/consumables/c_menu) else: RESP.redirect(/store_nic/consumables/index_html) below is zsql method chkpwd : select distinct(password) from c_userdet where username=<dtml-sqlvar uname type="string"> and password=<dtml-sqlvar pwd type="string"> i wanted to avoid d middle python script n handle the pwd validation in the same zpt . is it possible. i have carry req vars eg. username pwd ,districtname in session for future use. plz giv soln . On Tue, 29 Mar 2005 19:07:00 +0200, Andreas Pakulat <apaku@gmx.de> wrote:
On 29.Mär 2005 - 05:39:42, prabuddha ray wrote:
Danke Jürgen, one tip i'm lookin for is how to cal pyhton scripts on any form event, ie. like we call javascripts on the onclick or onsubmit or onchange events? thanks again.
You can't. Python and JavaScript are completely different things. JavaScript runs on the client side, whereas Python runs on the server. However, you probably can use your JavaScript to call a python Script, but I wouldn't suspect that it works the same as with JavaScript alone. Python Scripts are executed when you send them a Request or by calling them from within another python script (or TAL or DTML statement)
Andreas
-- You have an ambitious nature and may make a name for yourself. _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- Share the vision of difference with ME
wats wrong with the given puthon script request = container.REQUEST RESP = request.RESPONSE passwd = context.request.password1 user = context.request.username, if(container.chkpwd(uname=user,pwd=passwd)): RESP.redirect(/store_nic/consumables/test) // syntax errror. else: RESP.redirect(/store_nic/consumables/index_html) On Tue, 29 Mar 2005 19:07:00 +0200, Andreas Pakulat <apaku@gmx.de> wrote:
On 29.Mär 2005 - 05:39:42, prabuddha ray wrote:
Danke Jürgen, one tip i'm lookin for is how to cal pyhton scripts on any form event, ie. like we call javascripts on the onclick or onsubmit or onchange events? thanks again.
You can't. Python and JavaScript are completely different things. JavaScript runs on the client side, whereas Python runs on the server. However, you probably can use your JavaScript to call a python Script, but I wouldn't suspect that it works the same as with JavaScript alone. Python Scripts are executed when you send them a Request or by calling them from within another python script (or TAL or DTML statement)
Andreas
-- You have an ambitious nature and may make a name for yourself. _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- Share the vision of difference with ME
wats wrong with the given puthon script request = container.REQUEST RESP = request.RESPONSE passwd = context.request.password1 user = context.request.username, if(container.chkpwd(uname=user,pwd=passwd)): RESP.redirect(/store_nic/consumables/test) // syntax errror. else: RESP.redirect(/store_nic/consumables/index_html) On Tue, 29 Mar 2005 19:07:00 +0200, Andreas Pakulat <apaku@gmx.de> wrote:
On 29.Mär 2005 - 05:39:42, prabuddha ray wrote:
Danke Jürgen, one tip i'm lookin for is how to cal pyhton scripts on any form event, ie. like we call javascripts on the onclick or onsubmit or onchange events? thanks again.
You can't. Python and JavaScript are completely different things. JavaScript runs on the client side, whereas Python runs on the server. However, you probably can use your JavaScript to call a python Script, but I wouldn't suspect that it works the same as with JavaScript alone. Python Scripts are executed when you send them a Request or by calling them from within another python script (or TAL or DTML statement)
Andreas
-- You have an ambitious nature and may make a name for yourself. _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- Share the vision of difference with ME
-- Share the vision of difference with ME
Maybe using quotes........ e.g. RESP.redirect('/store_nic/consumables/test') prabuddha ray wrote:
wats wrong with the given puthon script
request = container.REQUEST RESP = request.RESPONSE
passwd = context.request.password1 user = context.request.username,
if(container.chkpwd(uname=user,pwd=passwd)): RESP.redirect(/store_nic/consumables/test) // syntax errror. else: RESP.redirect(/store_nic/consumables/index_html)
On Tue, 29 Mar 2005 19:07:00 +0200, Andreas Pakulat <apaku@gmx.de> wrote:
On 29.Mär 2005 - 05:39:42, prabuddha ray wrote:
Danke Jürgen, one tip i'm lookin for is how to cal pyhton scripts on any form
event,
ie. like we call javascripts on the onclick or onsubmit or onchange
events?
thanks again.
You can't. Python and JavaScript are completely different things. JavaScript runs on the client side, whereas Python runs on the server. However, you probably can use your JavaScript to call a python Script, but I wouldn't suspect that it works the same as with JavaScript alone. Python Scripts are executed when you send them a Request or by calling them from within another python script (or TAL or DTML statement)
Andreas
-- You have an ambitious nature and may make a name for yourself. _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- Share the vision of difference with ME
participants (5)
-
Andreas Pakulat -
Lennart Regebro -
prabuddha ray -
prabuddha ray -
Vangelis Mihalopoulos