If on a specific page, show different options in pull down menu

I have a pulldown menu that allows the user to select the page they want to see next. However, i do not want to show the option for the page they are currently on. How might i code this?

-------

Psuedo, if on page, type2, do not show the option type2.

Ex.
<cfform action="AHprocess.cfm" method="post">
      <select name="Specify">
        <option value="All" selected>All Classes</option>
        <option value="type1">Residential</option>
        <option value="type2">Commercial</option>
        <option value="type3">Multi Family</option>
        <option value="type4">Land</option>
        <option value="type5">Rentals</option>
        <option value="type6">For Lease</option>
      </select>
      <input type="submit" value="Refresh">
    </cfform>
zakirdavisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pinaldaveCommented:
well if that is the case and this are static variables and not comming from query then I see only one way to do it...
<cfparam name = "AHProcess.cfm" default="">
<cfform action="AHprocess.cfm" method="post">
      <select name="Specify">
        <option value="All" selected>All Classes</option>
        <cfif form.AHprocess.cfm eq 'type1'><cfelse><option value="type1">Residential</option></cfif>
        <cfif form.AHprocess.cfm eq 'typ21'><cfelse><option value="type2">Commercial</option></cfif>
        <cfif form.AHprocess.cfm eq 'type3'><cfelse><option value="type3">Multi Family</option></cfif>
        <cfif form.AHprocess.cfm eq 'type4'><cfelse><option value="type4">Land</option></cfif>
        <cfif form.AHprocess.cfm eq 'type5'><cfelse><option value="type5">Rentals</option></cfif>
        <cfif form.AHprocess.cfm eq 'type6'><cfelse><option value="type6">For Lease</option></cfif>
      </select>
      <input type="submit" value="Refresh">
    </cfform>

something like this... but I am assuming that this the values when the form is submitted... if you are controling your pages by url then replace the form by url or any other variable which is apropriate.
This is the idea.
Regards,
---Pinal
0
anandkpCommented:
I think it shld be

<CFPARAM NAME="form.Specify" DEFAULT="">

<cfif form.Specify neq 'type1'><option value="type1">Residential</option></cfif>
<cfif form.Specify neq 'type2'><option value="type2">Commercial</option></cfif>
<cfif form.Specify neq 'type3'><option value="type3">Multi Family</option></cfif>
...
..
.

PS : I wld suggest that u shld the option as selected [instead of hiding it] - so the user knows which page hes looking at !
eg : <option value="type1" <cfif form.Specify eq 'type1'> SELECTED </CFIF>>Residential</option>

K'Rgds
Anand
0
pinaldaveCommented:
>>PS : I wld suggest that u shld the option as selected [instead of hiding it] - so the user knows which page hes looking at !
>>eg : <option value="type1" <cfif form.Specify eq 'type1'> SELECTED </CFIF>>Residential</option>

I should have said the same before. If it is not requirement of hiding then just do it.
Anandkp buddy this should not be in PS that it should be title. I do the same all the time.
---Pinal
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

anandkpCommented:
Didnt get u Pinal !
0
pinaldaveCommented:
okey, I mean that your suggestion of keeping that selected is professional and practical. That is good to do.
I mean if user have no specific requirement then do not hide them and keep them selected as you have suggested Anand!!! ( I like your suggestion)
Regards,
---Pinal
0
zakirdavisAuthor Commented:
Basically what i wanted to do it make an IF statement that captures the URL that the user is currently looking at, and display the pulldown menue depending on the URL.

Ex.

If user is on the url http://www.site.com/RES.cfm

then show only Multi, Comm, Lease, Land.....

If user is on the url http://www.site.com/Comm.cfm
then show only Multi, Res, Lease, Land....

This is what i was looking for, as I am not passing variables in my URL.

---
Sample code of my process page:
---

<cfif #Form.Specify# EQ "res">
  <script>
       self.location="res.cfm";
    </script>
  <cfelseif #Form.Specify# EQ "multi">
  <script>
       self.location="multi.cfm";
    </script>
  <cfelseif #Form.Specify# EQ "land">
  <script>
       self.location="land.cfm";
    </script>
  <cfelseif #Form.Specify# EQ "comm">
  <script>
       self.location="comm.cfm";
    </script>
  <cfelseif #Form.Specify# EQ "rent">
  <script>
       self.location="rent.cfm";
    </script>
  <cfelseif #Form.Specify# EQ "lease">
  <script>
       self.location="lease.cfm";
    </script>
  <cfelseif #Form.Specify# EQ "all">
  <script>
       self.location="index.cfm";
    </script>
  <cfelse>
  <script>
        alert("Going to index.cfm");
        self.location="index.cfm";
    </script>
</cfif>

<!--- All of the above pages (res.cfm, multi.cfm...) have an include file that shows the same Pull-Down Menue (shown above) --->
0
pinaldaveCommented:
My suggestions not good as Anand's suggestion that is what i wrote above.
0
zakirdavisAuthor Commented:
I tried Anands. Didnt do what i wanted. I want it to check the current url of the page and not check the form data.
0
pinaldaveCommented:
okey buddy then change form.variable to url.variable in Anand's suggestion. it shoudl work.
0
sigmaconCommented:
to determine the template your on and to paint a drop down that forwards to a new page when you select one, your include file should look something like this:

<!--- determining the template that was called --->
<cfparam name="cgi.SCRIPT_NAME" default="index.cfm">
<cfif find('/', cgi.SCRIPT_NAME) eq 1>
      <cfset currentTemplate = right(cgi.SCRIPT_NAME, len(cgi.SCRIPT_NAME) - 1)>
<cfelse>
      <cfset currentTemplate = cgi.SCRIPT_NAME>
</cfif>

<cfset templates = 'res.cfm,multi.cfm,land.cfm,comm.cfm,rent.cfm,lease.cfm,index.cfm'>
<cfif not listFind(templates, currentTemplate)>
      <cfset currentTemplate = 'index.cfm'>
</cfif>


<!--- painting the navigation drop-down --->
<cfset templates = listToArray(templates)>
<cfset names = listToArray('Residential,Multi Family,Land,Commercial,Rent,For Lease,Home')>
<cfset numFiles = arrayLen(templates)>

<form method="index.cfm">
      <select name="Specify" size="1" onChange="if (this.value != 'dummy') self.location=this.value;">
            <option value="dummy">Select a page:</option>
            <cfloop index="i" from="1" to="#numFiles#">
                  <cfif templates[i] neq currentTemplate>
                  <cfoutput><option value="#templates[i]#">#names[i]#</option></cfoutput>
                  </cfif>
            </cfloop>
      </select>
</form>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
anandkpCommented:
<CFSET CurrPage = ListLast(Script_name,'/')> <!-- determines ur current page -->

<cfif CurrPage neq 'res.cfm'><option value="res.cfm">Residential</option></cfif>
<cfif CurrPage neq 'com.cfm'><option value="com.cfm">Commercial</option></cfif>
<cfif CurrPage neq 'multi.cfm'><option value="multi.cfm">Multi Family</option></cfif>
...
..
.

wld that help ?
lemme know ...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.