Solved

dropdown box onChange problems

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

825 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