LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   an html form question (https://www.linuxquestions.org/questions/programming-9/an-html-form-question-110659/)

matt_w_lambert 10-30-2003 09:20 PM

an html form question
 
i was wanderin if sombody new how to make a form that had a big textbox with a small textbox under it and when you type in the small textbox and hit submit
your text will be displayed in the big text box and it stays there for others to view and it is read only

sorry for the poor explanation it is hard for me to discribe

SaTaN 10-30-2003 09:48 PM

Code:

#!/usr/perl
use CGI qw/:standard/;
if($_GET['small_text'])
{
        $smalltext=$_GET['small_text']
        print " <html>\n
                <title>Big Text Display </tilte>\n
                <form name=text action=index.cgi method=get>\n
                This is the text box :: $smalltext;
                <input type=textbox name=name size=20 value=small_txt>\n
                <input type=submit value=submit>\n</html>";
}
else
{
        print " <html>\n
                <title>Big Text Display </tilte>\n
                <form name=text action=index.cgi method=get>\n
                This is the text box :: STILL NOT ENTERED ANYTHING ;
                <input type=textbox name=name size=20>\n
                <input type=submit value=submit>\n</html>";
}

I don't think using a big textbox is required for making the text readonly . It would be better if you just print it . That is what I have done

I also don't have a machine right now with me so please excuse me if there are any typos / anything

matt_w_lambert 10-30-2003 10:48 PM

how would i embed that into a html page ? i havent used perl much and its been a long time:tisk:

SaTaN 10-30-2003 11:41 PM

That is html page that I am generating . The output of this script is in html

You should use either cgi or php to do what you asked for

I do them in perl

<edit>See it is like this you are taking input and generating an another html page
in which the text in the small text box is printed in big text box.
So, the text will be a variable
This second html page is being generated dynamically . So, some program should be run on the server so that the html page can be generated .
For that I use either cgi or php and I do them in perl
I think you can even do them in C also
</edit>


All times are GMT -5. The time now is 03:19 PM.