RSS Forums RSS

Fields in HTML Form

Please support our Perl advertiser: Programming Forums
Reply
Posts: 11,327
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 123
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Fields in HTML Form

  #1  
Dec 10th, 2005
I am doing a perl project for school in which I am using CGI.pm. I am a complete perl novice.

With the following:

use CGI;
$query = new CGI;
print $query->startform({-action => "foo.cgi", -method => "post"});
print $query->p($query->textfield({-name => "bar"}));
print $query->submit({-name => "action", -value => "submit"});
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.

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!
Dani the Computer Science Gal
AddThis Social Bookmark Button
Reply With Quote  
Posts: 11,327
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 123
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: Fields in HTML Form

  #2  
Dec 10th, 2005
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.
Dani the Computer Science Gal
Reply With Quote  
Posts: 11,327
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 123
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: Fields in HTML Form

  #3  
Dec 10th, 2005
Well I just answered my hidden filed question ...
http://search.cpan.org/dist/CGI.pm/C...A_HIDDEN_FIELD
Dani the Computer Science Gal
Reply With Quote  
Posts: 11,327
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 123
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: Fields in HTML Form

  #4  
Dec 10th, 2005
I'm sorry folks, I still can't get the hidden form field to work for some reason?
Dani the Computer Science Gal
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 3965 | Replies: 3 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 1:19 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC