1

I'm trying to print a textbox within a form.

This is my code for the component of the form (within python):

print "<tr><td>Review </td><td>< input type=""textarea"" name=""Review"" cols=""50"" rows=""5""> "
print """
    Enter some text...
    </textarea>
    <br />

"""

But on the form, it ends up like this image

I'm sure it's just syntax, but I'm pretty new to HTML.

4 Answers 4

1

Try this one:

print "<tr><td>Review </td><td><input type=\"textarea\" name=\"Review\" cols=\"50\" rows=\"5\" />"
print """
    Enter some text...
    </textarea>
    <br />

"""
Sign up to request clarification or add additional context in comments.

Comments

1

You have a redundant whitespace between < and input. Just remove it:

print "<tr><td>Review </td><td><input type=""textarea"" name=""Review"" cols=""50"" rows=""5""> "

Comments

0

You must add \ before each " symbol like this:

print "<tr>
     <td>Review </td>
     <td><input type=\"textarea\" name=\"Review\" cols=\"50\" rows=\"5\" />"
print """
    Enter some text...
    </textarea>
    </td>    
"""

And you must close <td> correctly (you typed <br/> instead).

Comments

0
print "<tr><td>Review </td><td><textarea name=""Review"" cols=""50"" rows=""5"">Enter Some text"
print """
    </textarea>
    <br />

"""

This was actually the way I got it working... but yeah, the space after the < wasn't helping :P

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.