Solved

dropdown box onChange problems

Posted on 2003-12-12
3
374 Views
Last Modified: 2013-12-24
Hi Experts,

I got the scripts from EE and was testing on it, but there's some problems:

<script language="JavaScript">
      function gotosite(url)
      {
            window.location.href=url;

      }
</script>

<cfselect name="type" multiple="no" passthrough="onChange='gotosite(this.options[this.selectedIndex].value)'">
<cfoutput query="ssr_albumtype_list">
      <option value='photo_add.cfm?type=#albumtype#'>#albumtype#</option>
</cfoutput>      
</cfselect>


Dropdown values
- member
- public
Ok, When i select a value (public) from the dropdown, the page will refresh itself. But the type i selected did not change in the dropdown box, it is still (member). I can't select back the (member) value. What is wrong with my codes?

Jimbo
0
Comment
Question by:jimboVB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
anandkp earned 50 total points
ID: 9927886
is this what ur looking for

<CFSELECT NAME="type" MULTIPLE="no" PASSTHROUGH="onChange='gotosite(this.options[this.selectedIndex].value)'">
<CFOUTPUT QUERY="ssr_albumtype_list">
    <OPTION VALUE='PHOTO_ADD.CFM?TYPE=#ALBUMTYPE#' <CFIF ISDEFINED('TYPE') AND COMPARENOCASE(ALBUMTYPE,TYPE) EQ 0>Selected</CFIF>>#albumtype#</OPTION>
</CFOUTPUT>    
</CFSELECT>

let me know

K'Rgds
Anand
0
 
LVL 1

Author Comment

by:jimboVB
ID: 9928009
Alrite, that was a fast answer, thx.. XD

I got another question though, quicks answers too.. =P

Alrite, when i click on this link "photo_add.cfm" (without defining ?type= at the back) the server will give me an error. "TYPE is undefined in URL". What can i do?
0
 
LVL 1

Author Comment

by:jimboVB
ID: 9928033
well, nevermind, i got it solved.
just added this line of code

<cfparam name="url.type" default="all">

thanks for helping... ^^
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question