Closed Thread
Results 1 to 4 of 4

Thread: onchange select statement within CF

  1. #1
    jcschild is offline Newbie
    Join Date
    Nov 2008
    Posts
    2
    Rep Power
    0

    onchange select statement within CF

    Hi guys,
    pulling my hair out with this one.

    i want to have an image change when there is a change in the select item change, without having to refresh the page.

    the img url output looks like this

    Code:
    <cfoutput query="getsystems"><cfif #getsystems.Picture# is not ""><img name="" src=http//the url/systems/pictures\#Picture#" border="0"  alt="#getsystems.system_name#"></cfif></cfoutput>
    
    the select statement for said item:
    
    
    <cfoutput query="getcase">
    <option value="#recordid#" <cfif #recordid# is #getsystems_defaults.case#> selected</cfif>><cfif #manufacturer# is not "">#manufacturer# - </cfif>#left(item_name,"100")#   [<cfif #price# gt #caseprice#>+ #dollarformat(price-caseprice)#<cfelseif #price# lt #caseprice#>- #dollarformat(caseprice-price)#<cfelse>0</cfif>]</option>
    </cfoutput>
    </select>
    how to change the img url when select is changed?

    thanks
    scott
    Last edited by WingedPanther; 11-13-2008 at 09:01 AM. Reason: add code tags

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: onchange select statement within CF

    You will have to use JavaScript (possibly AJAX) to do that.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    jcschild is offline Newbie
    Join Date
    Nov 2008
    Posts
    2
    Rep Power
    0

    Re: onchange select statement within CF

    thats exactly what i was trying but having it with in the CF was giving me fits

    thanks
    scott

  5. #4
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: onchange select statement within CF

    CF cannot respond to what happens in the browser unless it is notified by either a form submission or an AJAX communication.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to insert into select statement using 2 tables?
    By newphpcoder in forum Database & Database Programming
    Replies: 5
    Last Post: 10-23-2011, 11:46 PM
  2. Syntax for Select Statement
    By newphpcoder in forum Database & Database Programming
    Replies: 2
    Last Post: 12-13-2010, 02:08 AM
  3. Two Problems Passing Variable & Select Where Statement
    By msebar in forum PHP Development
    Replies: 3
    Last Post: 12-31-2009, 08:29 AM
  4. Replies: 8
    Last Post: 10-03-2009, 04:46 PM
  5. Using one Alias for mutiple columns in a SELECT statement
    By reachpradeep in forum Database & Database Programming
    Replies: 0
    Last Post: 03-05-2007, 05:21 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts