[Zope] parameter prob remains

prabuddha ray buddha_2001 at rediffmail.com
Fri Mar 11 03:20:25 EST 2005


Ya i tried d the test code. its givin the district correctly with 
value.
i sud tell u wat am i doin in the javascript method 'user10()' i'm 
invoking on the onchange() of 1st dropdown list.

function user10(){
 	document.nlogin.user11.value='y'     //for username dummy 
value
         document.nlogin.action="index_html" //this page id
 	document.nlogin.method='post'
         document.nlogin.submit()
}

its still givin that compilation error.

  Error Type
    KeyError
  Error Value
   'districtname'

the tal code i used was

<div tal:repeat="user 
python:context.getDistrictUser(districtname=request.form['districtname'])">
<option tal:content="user/username"></opt

I think wen the page is getting loaded its not finding the 
districtname variable. so have to initialize it for the 1st 
load.
something like
  <span tal:condition="districtname|nothing" tal:omit-tag="">
    <!-- initialize explicitly here -->
</span>
  this is jus fancy. gimme a soln .i'm freaked out.
thanks again.


On Fri, 11 Mar 2005 Hong Yuan wrote :
>The request.form variable is set either through input fields in 
>an HTML form or parameters in the URL. Normally you don't have to 
>set it explicitly in your ZTP template.
>
>Do you have a field named 'districtname' in your form? If yes and 
>if the 'action' attribute of the form points to your page 
>template, then the 'districtname' variable should be available.
>
>You can check what varialbes are in the request.form by writing a 
>test template, like test.pt, with the content:
>
><p tal:content="structure request" />
>
>and then point the 'action' attribute of your form to 'test'. If 
>'districtname' is not there, then maybe you should check your 
>HTML code.



More information about the Zope mailing list