开发者

How to get the content of textarea

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜