PHP capture OptionGroup

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

PHP capture OptionGroup

Post by kendall »

hi,

is there anyway you guys ever came across or came up with to capture the

Code: Select all

<!-- i want to get the label as well as the options selected in it as necessary when posted -->
<optgroup label="Label"> 
</optgroup>
of a form when $_POSTed?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If memory serves, that information isn't submitted.
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Post by Rovas »

I used and it worked

Code: Select all

if (empyt($_POST["label"])) {echo "You didn' t select x option";}
  else {//code }
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Post by kendall »

Rovas wrote:I used and it worked

Code: Select all

if (empyt($_POST["label"])) {echo "You didn' t select x option";}
  else {//code }
Really? wow...wait a minute...there are <label> tags and then there is the <otpgroup label=""> you sure you got the right one?


ok i will check this out...thanks

Kendall
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

as a rule of thumb "if it hasn't a name attribute it's not submitted"
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Why can't you just do a test post and var_dump($_POST)? That would tell you everything you need to know about what is posted without anyone here speculating as to what you can or cannot do.
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Post by kendall »

Everah wrote:Why can't you just do a test post and var_dump($_POST)? That would tell you everything you need to know about what is posted without anyone here speculating as to what you can or cannot do.
oooooooooh wowwww ok
Post Reply