Solved

dropdown box onChange problems

Posted on 2003-12-12
3
367 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
  • 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

Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Script 12 114
connection string question 2 66
IIS Site Configuration Copy 2 68
Tool to email me when a website changes 29 106
This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now