[Zope] pass variables in a form

2006-04-03 Thread Dean Hale
Hi,I hope this is the correct forum to add this query, and any help appreciated.I have the following zpt which pulls in the users userid - $uid and some text generated from a python script (myEV - $pass). It works fine however i need to pass the variables along in a form rather than a url. And i'm stuck.the zpt urlspan tal:define="pass here/myEv"    a href="" tal:define="uid python:member.getProperty('uid')" tal:attributes="href string:https://domain/siw_sso.signonUSER=$uidTEXT=$pass" method="post"SSO test/a/span       the form needs to be in a format similar to belowform method="post" action=""https://domain/siw_sso.signon">https://domain/siw_sso.signon"input type="hidden" name="SSO" value="USER=ws0dhaHASH=daf768422238acd0899155a1757c9b5d" This is a test of hardcoded single-signon input type="submit" value="for ws0dha"/formso somehow i need to pass something like belowinput type="hidden" name="SSO" value="USER=$uidTEXT=$pass"hope this makes sense and is it possible?thank youdean    --- Dean Hale  Web Development Manager Library Services  University of Sunderland  w: https://my.sunderland.ac.uk  t: +44 (0) 191 515 2424 f: +44 (0) 191 515 2904  ___
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 )


Re: [Zope] pass variables in a form

2006-04-03 Thread Tino Wildenhain

Dean Hale schrieb:


Hi,

I hope this is the correct forum to add this query, and any help 
appreciated.


I have the following zpt which pulls in the users userid - $uid and some 
text generated from a python script (myEV - $pass). It works fine 
however i need to pass the variables along in a form rather than a url. 
And i'm stuck.


the zpt url

span tal:define=pass here/myEv
a href= tal:define=uid python:member.getProperty('uid') 
tal:attributes=href 
string:https://domain/siw_sso.signonUSER=$uidTEXT=$pass 
https://domain/siw_sso.signonUSER=$uidTEXT=$pass method=postSSO 
test/a
/span   


the form needs to be in a format similar to below

form method=post action=https://domain/siw_sso.signon;
input type=hidden name=SSO 
value=USER=ws0dhaHASH=daf768422238acd0899155a1757c9b5d
 This is a test of hardcoded single-signon input type=submit 
value=for ws0dha

/form

so somehow i need to pass something like below

input type=hidden name=SSO value=USER=$uidTEXT=$pass

hope this makes sense and is it possible?


Its possible but does not make sense. In HTML-forms
the element has a name which corresponds to the
variable name you get after form data evaluation
by the server. So in your case you really want:

form method=post ... 
 input type=hidden name=USER tal:attributes=value uid /
 input type=hidden name=TEXT tal:attributes=value pass /
 input type=submit value=for ws0dha /
/form

(assumed you nicely pull out uid,pass and so on from your
python script)

btw, if you construct links with parameters, its by far nicer
to do this in your python script, using ZTUtils.make_query()

Regards
Tino
___
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 )