Zeynel
Zeynel

Reputation: 13525

How to get the content of textarea

I have 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.

Upvotes: 0

Views: 2480

Answers (1)

Chris Morgan
Chris Morgan

Reputation: 90832

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.

Upvotes: 3

Related Questions