Fields in HTML Form

Reply

Join Date: Feb 2002
Posts: 12,036
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 cscgal is a glorious beacon of light 
Solved Threads: 130
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Fields in HTML Form

 
0
  #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:

  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.

  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!
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,036
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 cscgal is a glorious beacon of light 
Solved Threads: 130
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: Fields in HTML Form

 
0
  #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
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,036
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 cscgal is a glorious beacon of light 
Solved Threads: 130
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: Fields in HTML Form

 
0
  #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
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,036
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 cscgal is a glorious beacon of light 
Solved Threads: 130
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: Fields in HTML Form

 
0
  #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
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC