944,076 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Unsolved
  • Views: 4827
  • Perl RSS
Dec 10th, 2005
0

Fields in HTML Form

Expand Post »
I am doing a perl project for school in which I am using CGI.pm. I am a complete perl novice.

With the following:

Perl Syntax (Toggle Plain Text)
  1. use CGI;
  2. $query = new CGI;
  3. print $query->startform({-action => "foo.cgi", -method => "post"});
  4. print $query->p($query->textfield({-name => "bar"}));
  5. print $query->submit({-name => "action", -value => "submit"});
  6. print $query->endform();

My question is what is the syntax to add a hidden form field?

---

I have a second question as well. I would like to create a form field that is a drop down menu.

Perl Syntax (Toggle Plain Text)
  1. print $query->popup_menu({-name => "foo", -values => ["bar", "baz", "bat"]});

I have an array of possible values for the dropdown, @values. However, doing -values => $values doesn't seem to work, so how exactly can I do it? Is it @values or am I just completely way off base? Gah!
Similar Threads
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is online now Online
13,646 posts
since Feb 2002
Dec 10th, 2005
0

Re: Fields in HTML Form

PS ... Yes, I know that I could just use a print statement to write out <input type="hidden" ... but I was wondering if there was some CGI.pm shortcut.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is online now Online
13,646 posts
since Feb 2002
Dec 10th, 2005
0

Re: Fields in HTML Form

Well I just answered my hidden filed question ...
http://search.cpan.org/dist/CGI.pm/C...A_HIDDEN_FIELD
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is online now Online
13,646 posts
since Feb 2002
Dec 10th, 2005
0

Re: Fields in HTML Form

I'm sorry folks, I still can't get the hidden form field to work for some reason?
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is online now Online
13,646 posts
since Feb 2002

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Perl Forum Timeline: Trouble Expanding a bus in PERL
Next Thread in Perl Forum Timeline: I get the error no file or directory when i try to run a perl script





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC