Link to home
Avatar of Larry Vollmer
Larry Vollmer

asked on

If question

I have a select box that looks like this:

<OPTION VALUE="Take out" defaultSelected selected >Take out</OPTION>
<OPTION VALUE="Accessible" >Accessible</OPTION>
<OPTION VALUE="Cocktails" >Cocktails</OPTION>
<OPTION VALUE="Cooking Classes" >Cooking Classes</OPTION>
<OPTION VALUE="Dancing" defaultSelected selected >Dancing</OPTION>

On the next page I always want to ignore "Cooking classes" and "dancing" if they are selected as options.

I can't figure out how to do this using a simple if statement. Can anyone help me out?
Avatar of nplib
nplib
Flag of Canada image

what do you mean by ignore,
and can you post the rest of your code?
Avatar of Guy Hengel [angelIII / a3]
>On the next page I always want to ignore "Cooking classes" and "dancing" if they are selected as options.
what do you mean be "ignore"? what context/code?
Avatar of Larry Vollmer
Larry Vollmer

ASKER

"Cooking classes" and "dancing" and "cocktails" are selected, I only want to return the value for cocktails. Cooking classes and dancing should always be omitted.
why would dancing be omitted?
im exporting data from a database to an XML file to send to someone else.  They only want to use a few of our select options.  we need all of them in house, but I need to somehow omit those values , if they are selected, when sending them to the 3rd party.
>Cooking classes and dancing should always be omitted.
again: in what context of code?
how are you reading the "selection" list?
can you post your export to xml code?
anyhow, the data will be in $_REQUEST ( ie $_POST or $_GET ) ...
you take the data from there, presumable into a temp array.
in that loop, check for the items you want to be omitted, and just don't copy them...
it's sometype of automated system, but here is an example of another field

  {if ($VenueCustomAttrib96 == "yes"):

              return "yes";

             else:

              return "";

             endif;}

I guess would I want to say is if any of those values are selected, ignore them completely. not sure how to do it.
POST WHOLE CODE.

I don't see first hand how this
{if ($VenueCustomAttrib96 == "yes"):

              return "yes";

             else:

              return "";

             endif;}
has to do with the problem directly, it may but I can't infer that from this little snippet.
I can't post the code. It's all done through a CMS.

All I can do is assign the values I want from the CMS to the XML file.

In the instance above, I showed an example of how the value "Yes" would be assigned to

I am looking to do something similar with

I just need to store the select data somehow, omitting those two values and keeping anything else that may appear.
ASKER CERTIFIED SOLUTION
Avatar of imgriff
imgriff

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
>> What is the name given to the SELECT control
VenueCustomAttrib7

What do I put in the // to make it add or ignore?

Thanks
the // lines are comments.

Put in there whatever you're doing to place that data into your XLM file.

You don't really need the IF statements where you ignore the value. I only put it there to show you what I meant in the code.
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Arg.. it seems Experts Exchange has translated my list HTML into actual HTML :| .  The $html.="
  • ".$value."
  • " line is actually meant to appear as the code attached below:
    $html.="<li>".$value."</li>"
    

    Open in new window