Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7921049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:26:25+00:00 2026-06-03T16:26:25+00:00

So, I am totally new with CGI programming in Perl. The question is simple.

  • 0

So, I am totally new with CGI programming in Perl.
The question is simple. Is there any chance to delete the content of a text field in CGI?

I must to write a code that have some popup_menu, submit button and text fields (area).

When I click on the submit button the program reads the value from one of the popup_menu.
The task is to copy this content into text field and then when I choose another element from the popup_menu (and click on the submit button of course), let the new content write into the text field replace the old one.

I think perldoc.perl.org gives only a little information about CGI programming. I’d have lot of questions in thema… 🙁

Any help would be approciate!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:26:26+00:00Added an answer on June 3, 2026 at 4:26 pm

    I guess, what you describe is: when you click the submit button, then your cgi script will run, given the parameters you entered in the form. What I then has to do is: write something back and print the form again – with different values.

    So even if this is not the perfect way of doing such kind of things (for simple form element substitution you should do it client side and use javascript – you don’t need a cgi backend script for this), let’s see how a cgi script might look like.

    First it’s important to know, how you write your form. Let’s assume you write it “the hard way” with print.
    What your script has to do is parse the input and then add it as a value to the output.

    use CGI;
    my $q = CGI->new;
    
    # get the value from the popup / html select
    my $popup_value = $q->param('popup_menu'); # name of the <select name="..."> in your html
    # ...
    
    # writing the form
    print $q->header;
    # some more prints with form etc.
    print textarea( -name    => 'text_area',
                    -default => $popup_value // '', # will use empty string on first call
                  );
    # Don't turn off autoescaping !
    

    BTW, the value of a select option is meant to be a short indicator, not a full text (even this might be possible up to a certain amount of characters). So you might think of building a hash or an array with the appropriate values to be printed in the text area and give your select options the values 0, 1, 2 …

    my @text_values = ('', 'First text', 'second text', 'third text');
    my $popup_value = $q->param('popup_menu') || 0; # default index.
    # now use 1,2,3, ... as values in your popup_menu options
    # ...
    print textarea( -name    => 'text_area',
                    -default => $text_values[$popup_value] );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Totally new to programming so kindly excuse the silly question. I have this URL
I'm totally new to this WCF Services thing so any guidelines would be greatly
So I'm totally new to Haskell, hope it doesn't show too much. By any
I'm totally new in OpenCV so hopefully that's not a too stupid question. As
Hi I'm totally new to Prestashop and installing it first time can any one
I'm totally new on this so I want to start with something simple. I
I'm totally new to flash, and I'm trying to build a very simple app.
I'm totally new to Ruby but not to programming. All I did was going
Totally new to Kubuntu and KDevelop. I created a new No GUI(CMake) Simple CMake-based
I´m totally new to programming in java, and following some basic tutorials for my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.