0

Apparently my note was removed. This is very similar to other answers already out there. I explained that I have tried them all and nothing has worked for me. There are 7 or 8 possibilities I found here on stackoverflow and had no luck with them. There is something I'm missing and can't figure it out. Please help!

We have a script that creates a vehicle selection tool on our dev website. It works great when a single use is in place. However, if there are two versions they conflict. Each instance has a unique id and no matter how I code it, they will not work together. Its probably something obvious, but I don't have the experience to spot it. I've tried all the solutions I could find to attempt to correct the problem and I keep falling short. Depending on how I do the id selectors I can get one or the other to work, but not both. I'm sure it's something obvious that I just don't have the experience to discover.

Code snippets:

function selectVehicleDialog(showCloseButton) {
  jQuery("#select-vehicle,#select-vehicle2").dialog('open');
  if(showCloseButton == true){
    jQuery('.ui-dialog-titlebar-close').remove();
  }
  loadVehicleFinder('-header');
}

Extensive code trimmed out here as requested

});

When they are both on the page simultaneously, I can change the selectors and make one or the other work.

  • Possible Duplicate of http://stackoverflow.com/questions/7079011/jquery-multiple-id-selectors – 9Deuce Apr 09 '15 at 13:57
  • 2
    There's too much going on here. Please try to just show us the problem you're having. – Pedro Estrada Apr 09 '15 at 13:59
  • @pedro I trimmed the script and removed the html. Hope that helps simplify it. – Billy Bergman Apr 09 '15 at 14:09
  • @9deuce - I've actually tried 7 or 8 different solutions found here on this site and none worked for me. I'm still learning and not having any luck. – Billy Bergman Apr 09 '15 at 14:10
  • How about `$.each($('#id1, #id2'), function(){ $(this).dialog('open'); });` ? Was that one of your attempts? – Tim Vermaelen Apr 09 '15 at 14:39
  • @Tim, yes I tried that one. I even re-tried it right now to confirm. It's possible that I am implementing it incorrectly, but I'm not fluent in jQuery or JavaScript enough to see it. – Billy Bergman Apr 09 '15 at 14:59

0 Answers0