Solved

dropdown box onChange problems

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Firewall Speed Issue 6 77
LAMP problem identifier tool ? 9 130
System Analysis 5 70
change time in cron 4 105
In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

737 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