IF statements ?

1. Member
Join Date
Dec 1969
Posts
34

## IF statements ?

2. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## What's the problem?

I haven&#039;t looked too closely, but I want to know what to look for.<BR><BR>Yes, you can nest IF statements.

3. Member
Join Date
Dec 1969
Posts
34

## RE: What's the problem?

Basically I have a menu if the variable is about I want it to display the about menu button w/o a link, otherwise it has a link. But the about menu button has a submenu with three submenu items. Basically now I&#039;ve inserted three more if statements within the original if statement to control the highlighting for each subitem. Hope this helps

4. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## Is it not working?

I&#039;m asking if you are getting an error, or it isn&#039;t working or what.<BR><BR>You might want to try to simplify the page - instead of generating a bunch of HTML output, strip down the page to saying:<BR><BR>&#060;% If a = 1 Then %&#062;<BR> -- a = 1 --&#060;br /&#062;<BR>&#060;% Else %&#062;<BR> -- else --&#060;br /&#062;<BR> &#060;% If b = 123 Then %&#062;<BR> -- b = 123 --&#060;br /&#062;<BR> &#060;% ElseIf c = 456 Then %&#062;<BR> -- c = 456 ---<BR> &#060;% End If %&#062;<BR>&#060;% End If %&#062;<BR><BR>That way, you can see EXACTLY what is happening.<BR><BR>And, it helps to show what the value of your variables are JUST before the IF statements.

5. Member
Join Date
Dec 1969
Posts
34

## RE: Is it not working?

OK, I think I got what you mean. Here is a stripped down version. <BR><BR>&#060;% if loc = "about" then %&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;<BR> About the Conference <BR> &#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;<BR> &#060;% if loc = "about" then %&#062;<BR> - Committee<BR> &#060;% else %&#062;<BR> - &#060;a href=""&#062;Committee&#060;/a&#062;<BR> &#060;% end if %&#062;<BR> &#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;<BR> &#060;% if loc = "cosponsors" then %&#062;<BR> - Co-Sponsors<BR> &#060;% else %&#062;<BR> - &#060;a href=""&#062;Co-Sponsors&#060;/a&#062;<BR> &#060;% end if %&#062;<BR> &#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;<BR> &#060;% if loc = "video" then %&#062;<BR> - Video Conference Opportunities<BR> &#060;% else %&#062;<BR> - &#060;a href=""&#062;Video Conference Opportunities&#060;/a&#062;<BR> &#060;% end if %&#062; <BR> &#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;% else %&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;<BR> &#060;a href=""&#062;About the Conference&#060;/a&#062;<BR> &#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;% end if %&#062;

6. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## I would have went a little..

.. further, but it&#039;s a good start.<BR><BR>Now, I see a problem right off of the jump.<BR><BR>Your first IF statement is:<BR>&#060;% if loc = "about" then %&#062;<BR><BR>Then, everything else is within that IF statement, right?<BR><BR>So, from that point on, everything is only processed IF loc = "about". But, you keep checking to see if LOC is NOT "about".<BR><BR>For all of the others, you make the decision to show the link or the text all in one block. Why did you break the "About the Conference" up so much? Do it the same way as the others.

7. Member
Join Date
Dec 1969
Posts
34

## RE: I would have went a little..

See the menu is supposed to be displayed like the following...<BR><BR>About the Conference<BR>-Committee<BR>-Co-Sponsors<BR>-Video Conferencing<BR><BR>the Co-sponsors and video conferencing pages are different pages. So if for example a user selects the Video Conferencing link, I&#039;d like the link to be removed from Video Conferencing, but since it&#039;s a part of About the Conference, I&#039;d like for the link to remain off it as well, but the other two links should be active again. Thanks again for all of your help.<BR>

8. Member
Join Date
Dec 1969
Posts
34

## RE: I would have went a little..

Should I use like ElseIf statements in there???

9. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## Ok, that makes sense..

.. but, when you make the decision to show the About heading, you need to check to see if it is any of the subpages:<BR><BR>If loc = "about" Or loc = "video" Or loc = "other" Then<BR> %&#062;-- About&#060;%<BR>Else<BR> %&#062;&#060;a href="#"&#062;-- About&#060;/a&#062;&#060;%<BR>End If<BR><BR>If loc = "about" Then<BR> %&#062;-- -- Sub 1&#060;%<BR>Else<BR> %&#062;&#060;a href="#"&#062;-- -- Sub 1&#060;%<BR>End If<BR><BR>If loc = "video" Then<BR> %&#062;-- -- Video&#060;%<BR>Else<BR> %&#062;&#060;a href="#"&#062;-- -- Video&#060;%<BR>End If<BR><BR>See what I mean?

10. Member
Join Date
Dec 1969
Posts
34

## RE: Ok, that makes sense..

Man, I owe you big time!!!! Thanks so much. It&#039;s people like you that are willing to lend a helping hand, that makes learning such an enjoyable experience. Thanks again!!!!!!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•