TEXTAREA 요소는 여러 줄 텍스트가 CGI 프로그램에 전달되어야 할 때 사용됩니다.
예시
다음은 TEXTAREA 상자가 있는 양식의 HTML 코드 예입니다.
<form action = "/cgi-bin/textarea.py" method = "post" target = "_blank"> <textarea name = "textcontent" cols = "40" rows = "4"> Type your text here... </textarea> <input type = "submit" value = "Submit" /> </form>
이 코드의 결과는 다음 형식입니다. -

다음은 웹 브라우저에서 제공한 입력을 처리하는 textarea.cgi 스크립트입니다. -
#!/usr/bin/python
# Import modules for CGI handling
import cgi, cgitb
# Create instance of FieldStorage
form = cgi.FieldStorage()
# Get data from fields
if form.getvalue('textcontent'):
text_content = form.getvalue('textcontent')
else:
text_content = "Not entered"
print "Content-type:text/html\r\n\r\n"
print "<html>"
print "<head>";
print "<title>Text Area - Fifth CGI Program</title>"
print "</head>"
print "<body>"
print "<h2> Entered Text Content is %s</h2>" % text_content
print "</body>"