form attributes in an html file
Hi,
I need some help. I have an HTML file in my project which contains
a form. I would like that the attributes 'action' of my form is filled as
loaders.stan which is done like this:
tags.form(pattern='freeform-form', action=slot('form-artion'))[
...
]
I looked at the customform.tac example which uses the loaders.xmlstr and
filled the attributes this way:
<form nevow:pattern='freeform-form'>
On 6/21/2004, "vicky"
I looked at the customform.tac example which uses the loaders.xmlstr and filled the attributes this way: -(snip)- I've done the same thing in my HTML file and that doesn't works. I was wondering if there's another way to do this.
As far as I remember, nevow:attr only works with xmlstr/xmlfile, not htmlstr/htmlfile. If it were me, I would just have something like: # <form nevow:render="updateFormAction">..</form> def render_updateFormAction(self, ctx, data): if something: return ctx.tag(action='/something') else: return ctx.tag(action='/otherthing')
On Mon, 2004-06-21 at 17:57 -0400, Alex Levy wrote:
On 6/21/2004, "vicky"
wrote: I looked at the customform.tac example which uses the loaders.xmlstr and filled the attributes this way: -(snip)- I've done the same thing in my HTML file and that doesn't works. I was wondering if there's another way to do this.
As far as I remember, nevow:attr only works with xmlstr/xmlfile, not htmlstr/htmlfile.
No, I fixed that a while ago now. IIRC, it was before the 0.2.0 release. Cheers, Matt
If it were me, I would just have something like:
# <form nevow:render="updateFormAction">..</form> def render_updateFormAction(self, ctx, data): if something: return ctx.tag(action='/something') else: return ctx.tag(action='/otherthing')
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
-- __ / \__ Matt Goodall, Pollenation Internet Ltd \__/ \ w: http://www.pollenation.net __/ \__/ e: matt@pollenation.net / \__/ \ t: +44 (0)113 2252500 \__/ \__/ / \ Any views expressed are my own and do not necessarily \__/ reflect the views of my employer.
I'm using the latest version of nevow and I'm not able to use the nevow:attr in my html file. Do I have to put something special in my file. I want to fill the attribute action with form-action but I get this error : exceptions.KeyError: "Slot named 'form-action' was not filled." I've done the same thing with an xml file and everything was alright. Vicky -----Message d'origine----- De : twisted-web-bounces@twistedmatrix.com [mailto:twisted-web-bounces@twistedmatrix.com] De la part de Matt Goodall Envoyé : 21 juin, 2004 19:23 À : twisted-web Objet : Re: [Twisted-web] Re: form attributes in an html file On Mon, 2004-06-21 at 17:57 -0400, Alex Levy wrote:
On 6/21/2004, "vicky"
wrote: I looked at the customform.tac example which uses the loaders.xmlstr and filled the attributes this way: -(snip)- I've done the same thing in my HTML file and that doesn't works. I was wondering if there's another way to do this.
As far as I remember, nevow:attr only works with xmlstr/xmlfile, not htmlstr/htmlfile.
No, I fixed that a while ago now. IIRC, it was before the 0.2.0 release. Cheers, Matt
participants (3)
-
Alex Levy
-
Matt Goodall
-
vicky