I had this code that I wrote which changed the href of the page based on a
dropdown. It worked as a stand-alone page, but now that I'm integrating it
into my site, it's not working. Code is at the bottom of the page. Here's
what's happening:
 
1) On load, the make dropdown fills in with live data. This part works
perfect in both IE and FF.
 
2) By default the first make option is selected, which tnen triggers all
models for that make. In this example, Honda is first, so it loads
    2007 Accord and 2007 Civic.
    - In FF, the Civic is the selected option, in IE the selected option is
"--please select a model--" with the Accord and the Civic loaded after.
    - In IE, the selected option is correct
 
3) When the user changes the Make, it should reload the model dropdown with
live data.
    - This works in FF, but for some reason does not work in IE
 
Does anyone have any ideas?
 
 
 
-------------------
  <form>
   <input type="hidden" id="invPageid" value="30536" />
   Make:<br />
   <select id="make" disabled="true">
    <option>loading...</option>
   </select><br />
 
   Model:<br />
   <select id="model" disabled="true">
    <option>loading...</option>
   </select>
  </form>
 
Here's the jQuery code:
$(document).ready( function() {
 
  getMakeSelect();
 
  $('#make').bind("change",function(){
   var modelSelect = $('#model');
   getModelSelect($(this).val());
  });
  
  $('#model').change( function(){
   var selModel = $('#model').val().replace(/ /g,"%20");
   alert($('#model'));
   // var invid = $('#invPageid').val();  
   // var urlString = '/pages/page.cfm?pageid=' + invid +
'&pagetype=35&featureid=-1&model=' + selModel; 
   // location.href = urlString;
  });
  
  function getMakeSelect() { 
   // load in the make dropdown
   $.get("/Includes/ds3relatedselects.cfm", {method:'getMakesInInventory'},
function(data){
    var tempData = data.split('!!!')
    $('#make').removeAttr('disabled').html(tempData[1]);
    re = /value="(\w+)"/i;
    found = tempData[1].match(re);
    getModelSelect(found[1]);
   }); 
  }
  
  function getModelSelect(make) {
   var modelSelect = $('#model');
   modelSelect.attr('disabled','true').html('<option>loading...</option>');
   $.get("/Includes/ds3relatedselects.cfm",
{method:'getModelsInInventoryByMake',make:make}, function(data){
    var tempData = data.split('!!!')
    modelSelect.removeAttr('disabled').html(tempData[1]);
   });  
  }
 
});
 
 
____________________________________
 
Andy Matthews
Senior Coldfusion Developer

Office:  877.707.5467 x747
Direct:  615.627.9747
Fax:  615.467.6249
[EMAIL PROTECTED]
www.dealerskins.com <http://www.dealerskins.com/> 
 

<<dealerskinslogo.bmp>>

Reply via email to