开发者

How to get the content of textarea

开发者 https://www.devze.com 2023-04-06 01:47 出处:网络
I h开发者_如何学Goave this textarea form: self.response.out.write(\"\"\" <form name=\"title\"

I h开发者_如何学Goave this textarea form:

self.response.out.write("""        

<form name="title" 
action="/edittitlepitchhandler" 
method="post">            

...

pitch: <br />
<textarea name="new_pitch" rows="13" cols="75">
"%s"
</textarea><br /><br />

...                    

<input type="submit" 
value="submit">
</form>""" % (..., m.pitch, ...) )

I am trying to get the content of the textarea with "%s" but I think the "%s" inside <textarea></textarea> is picked up as initial text and the textarea box contains quotes. How do I get the content of the textarea so that I can open it later and edit it?

Thanks.

Edit

As per Chris Morgan's comment I deleted the quotes and removed the spaces before %s like this

pitch: <br />
<textarea name="new_pitch" rows="13" cols="75">%s</textarea><br /><br />

Now it works. Thanks.


The textarea displays all the text inside it, so if you put <textarea>"%s"</textarea>, it'll put the quotes in as well. Scrap the quotes and it'll just show the expanded %s.

0

精彩评论

暂无评论...
验证码 换一张
取 消