Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display textarea

Status
Not open for further replies.

filipel

Programmer
Aug 13, 2007
42
PT
hi.How to display a textarea below a button when i click on it?
 
You would have to use javascript (or any other client side code) to create a script that would either show/hide or create the textarea document when clicking on the button. The chaps at forum216 would be better to advise you on the script.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
You could use a Perl script. Set the form containing the button action to the perl script (i.e. textarea.pl). And the perl just prints a text area. To have it come up below you would want to use an iframe, so you would also have to set the buttons target to the iframe.

The perl script would look something like this... Save this file as textarea.pl and set permissions to chmod 755.

#! /usr/bin/perl
use strict;
use CGI ':standard';

print LOG<<"HTML code";
<HTML><HEAD>
<TITLE>Display Textarea</TITLE>

</HEAD><BODY>

<form method="POST" action="xxx">
<p><textarea rows="2" name="textarea" cols="20">Text here</textarea></p>
</form>

</BODY></HTML>

HTML code




And your html page with the button which opens the text area would be something like this


<html>

<head>
<title>XXX</title>
</head>

<body>

<form method="POST" action="textarea.pl target="frame">
<p><input type="button" value="Open Text Area" name="B1"></p>
</form>

<iframe src ="initial_iframe_page.htm" width="100%" height="100%" frameborder="no" name="frame"></iframe>

</body>

</html>
 
Yes probably, just perl is very compatible with HTML. The only issue I see is the perl script must be placed in a separate document. The option of removing the iframe is quite simple, by completing all processes in one script, including printing the HTML template using the script
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top