----- Original Message ----- From: "Kate Legere" <klegere@kfpl.ca> To: <zope@zope.org> Sent: Tuesday, February 13, 2007 3:38 PM Subject: [Zope] adding value to the path
When I submit this:
<input name="branch/manage_editProperties:method" type="submit" class="form-element" value="Save Changes" / >
It works very nicely. I'd like the user to choose the page to amend so I have a select option to choose the page (in this case the one named 'branch'
<select size="3" width="100" name="pageName"> <dtml-in "getParentNode().objectItems('DTML Document')" > <dtml-if "id() != 'index_html'"> <dtml-if "id() != 'editProperties'"> <option value="<dtml-var id>"> <dtml-var title_or_id></option> </dtml-if> </dtml-if> </dtml-in> </select>
And I think this ought to work.. but it doesn't...
<input name=document.propForm.pageName.value+"/manage_editProperties:method" type="submit" class="form-element" value="Save Changes" / >
It does absolutely nothing.
How do I pass it the value to the input name?
You create a separate html input tag that gets the information you require from the user, eg Enter Id: <input type="text" name="id:UTF-8:string" size="30" value=""/> If you already have some information that you want to pass along to the receiving method (ie. this information does not come from user input) then use a "hidden" input: <input type="text" name="id:UTF-8:string" size="30" value="<dtml-var someIdvar>"/> P.S. i just couldn't let this go:
<dtml-if "id() != 'index_html'"> <dtml-if "id() != 'editProperties'"> <option value="<dtml-var id>"> <dtml-var title_or_id></option> </dtml-if> </dtml-if>
is simpler as:
<dtml-if "id() != 'editProperties' and id() !=index_html"> <option value="<dtml-var id>"> <dtml-var title_or_id></option> </dtml-if>
Jonathan