Will the add class function allow me to create more specific selectors for drop downs with the same classes?jQuery: live change event on IE7First drop down menu to auto change the options of a second dropdownSwitching Dropdown ListAdd Item Drop Down ListCheck if drop-down has more than 1 optionHow to uncheck all checkboxes belonging to the same class on change in a drop down?Disable Drop-down using JQueryTablesorter filter - multiple drop down in the same table header cellHow to call different divs in same drop down menuDisable multiple checkboxes in dropdowns based on another selected checkbox of a first dropdown

LED lights on 1.2 V battery

Fishing from underwater domes

Is there research on the efficacy of taking good notes in math class?

How is the casino term "a high roller" commonly expressed in German?

How secure are public hashed passwords (with a salt)?

How can I store milk for long periods of time?

How do I get my neighbour to stop disturbing with loud music?

How does Query decide the order in which the functions are applied?

Does the telecom provider need physical access to the SIM card to clone it?

What is the motivation behind designing a control stick that does not move?

Problem with giving inputs to a function programmatically

In Toy Story, are toys the only inanimate objects that become alive? And if so, why?

Turn off Google Chrome's Notification for "Flash Player will no longer be supported after December 2020."

Would someone mind just getting me started with my Russian homework?

Divide Numbers by 0

How did the Altair 8800 front panel load the program counter?

Can I leave a large suitcase at TPE during a 4-hour layover, and pick it up 4.5 days later when I come back to TPE on my way to Taipei downtown?

Single vs Multiple Try Catch

Correct way of simplifying the result of an integral

How were US credit cards verified in-store in the 1980's?

Killing task by name - start menu shortcut

Why wasn't Linda Hamilton in T3?

Received email from ISP saying one of my devices has malware

Is the equational theory of groups axiomatized by the associative law?



Will the add class function allow me to create more specific selectors for drop downs with the same classes?


jQuery: live change event on IE7First drop down menu to auto change the options of a second dropdownSwitching Dropdown ListAdd Item Drop Down ListCheck if drop-down has more than 1 optionHow to uncheck all checkboxes belonging to the same class on change in a drop down?Disable Drop-down using JQueryTablesorter filter - multiple drop down in the same table header cellHow to call different divs in same drop down menuDisable multiple checkboxes in dropdowns based on another selected checkbox of a first dropdown






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm setting up several drop downs for users to customize their own coffee on our Blended Joe website on Shopify's platform using a third party Shopify App called Infinite Options to bypass the limit of 3 drop downs. With the current layout the user is able to :



  1. Choose an Origin

  2. Choose the Roast for that origin

  3. Make it a Blend/Choose a second option (Selecting this option will show a hidden div which will allow the user to complete the Roast for the second Origin they chose and concluded with choosing the ratio of the first and second blends.

Infinite Options has the same select class for all drop downs however it allows you to create a class and a name element to use for styling or selectors.



My issue is after I select the first Origin as Indonesia it affects the Choose your Roast Choice(expected) but it also affects the second Roast Choice.



Is there a way to use the addClass() function to specify the dropdown I want affected, or is there a way to specify my selectors so that it targets the correct drop down?



I tried creating a conditional that uses the name attribute to specify the correct dropdown



 $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground").change(function()
if ($('[name="properties[First Origin Choice]"]').val() == "Indonesia")
$("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").hide()
else

$("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").show()


if ($('[name="properties[First Roast Choice]"]').val() == "Light Roast")
$("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Indonesia']").hide()
else

$("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Indonesia']").show()



$("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option:selected").attr('disabled', 'disabled').siblings().removeAttr('disabled');
);

//second Origin Selection
$('select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground [name="properties[Second Roast Choice]"]').change(function()
if ($('select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground [name="properties[Second Origin Choice]"]').val() == 'Indonesia')
$("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").hide()
else

$("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").show()

);


You will see the full code on codepen: https://codepen.io/jcssll/pen/eXwRzW
Which as of just now is not working properly on Mac but the functionality of choosing the Indonesian origin and removing the Light Roast option value works well on my windows lap top.










share|improve this question






























    0















    I'm setting up several drop downs for users to customize their own coffee on our Blended Joe website on Shopify's platform using a third party Shopify App called Infinite Options to bypass the limit of 3 drop downs. With the current layout the user is able to :



    1. Choose an Origin

    2. Choose the Roast for that origin

    3. Make it a Blend/Choose a second option (Selecting this option will show a hidden div which will allow the user to complete the Roast for the second Origin they chose and concluded with choosing the ratio of the first and second blends.

    Infinite Options has the same select class for all drop downs however it allows you to create a class and a name element to use for styling or selectors.



    My issue is after I select the first Origin as Indonesia it affects the Choose your Roast Choice(expected) but it also affects the second Roast Choice.



    Is there a way to use the addClass() function to specify the dropdown I want affected, or is there a way to specify my selectors so that it targets the correct drop down?



    I tried creating a conditional that uses the name attribute to specify the correct dropdown



     $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground").change(function()
    if ($('[name="properties[First Origin Choice]"]').val() == "Indonesia")
    $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").hide()
    else

    $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").show()


    if ($('[name="properties[First Roast Choice]"]').val() == "Light Roast")
    $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Indonesia']").hide()
    else

    $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Indonesia']").show()



    $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option:selected").attr('disabled', 'disabled').siblings().removeAttr('disabled');
    );

    //second Origin Selection
    $('select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground [name="properties[Second Roast Choice]"]').change(function()
    if ($('select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground [name="properties[Second Origin Choice]"]').val() == 'Indonesia')
    $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").hide()
    else

    $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").show()

    );


    You will see the full code on codepen: https://codepen.io/jcssll/pen/eXwRzW
    Which as of just now is not working properly on Mac but the functionality of choosing the Indonesian origin and removing the Light Roast option value works well on my windows lap top.










    share|improve this question


























      0












      0








      0








      I'm setting up several drop downs for users to customize their own coffee on our Blended Joe website on Shopify's platform using a third party Shopify App called Infinite Options to bypass the limit of 3 drop downs. With the current layout the user is able to :



      1. Choose an Origin

      2. Choose the Roast for that origin

      3. Make it a Blend/Choose a second option (Selecting this option will show a hidden div which will allow the user to complete the Roast for the second Origin they chose and concluded with choosing the ratio of the first and second blends.

      Infinite Options has the same select class for all drop downs however it allows you to create a class and a name element to use for styling or selectors.



      My issue is after I select the first Origin as Indonesia it affects the Choose your Roast Choice(expected) but it also affects the second Roast Choice.



      Is there a way to use the addClass() function to specify the dropdown I want affected, or is there a way to specify my selectors so that it targets the correct drop down?



      I tried creating a conditional that uses the name attribute to specify the correct dropdown



       $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground").change(function()
      if ($('[name="properties[First Origin Choice]"]').val() == "Indonesia")
      $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").hide()
      else

      $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").show()


      if ($('[name="properties[First Roast Choice]"]').val() == "Light Roast")
      $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Indonesia']").hide()
      else

      $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Indonesia']").show()



      $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option:selected").attr('disabled', 'disabled').siblings().removeAttr('disabled');
      );

      //second Origin Selection
      $('select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground [name="properties[Second Roast Choice]"]').change(function()
      if ($('select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground [name="properties[Second Origin Choice]"]').val() == 'Indonesia')
      $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").hide()
      else

      $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").show()

      );


      You will see the full code on codepen: https://codepen.io/jcssll/pen/eXwRzW
      Which as of just now is not working properly on Mac but the functionality of choosing the Indonesian origin and removing the Light Roast option value works well on my windows lap top.










      share|improve this question














      I'm setting up several drop downs for users to customize their own coffee on our Blended Joe website on Shopify's platform using a third party Shopify App called Infinite Options to bypass the limit of 3 drop downs. With the current layout the user is able to :



      1. Choose an Origin

      2. Choose the Roast for that origin

      3. Make it a Blend/Choose a second option (Selecting this option will show a hidden div which will allow the user to complete the Roast for the second Origin they chose and concluded with choosing the ratio of the first and second blends.

      Infinite Options has the same select class for all drop downs however it allows you to create a class and a name element to use for styling or selectors.



      My issue is after I select the first Origin as Indonesia it affects the Choose your Roast Choice(expected) but it also affects the second Roast Choice.



      Is there a way to use the addClass() function to specify the dropdown I want affected, or is there a way to specify my selectors so that it targets the correct drop down?



      I tried creating a conditional that uses the name attribute to specify the correct dropdown



       $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground").change(function()
      if ($('[name="properties[First Origin Choice]"]').val() == "Indonesia")
      $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").hide()
      else

      $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").show()


      if ($('[name="properties[First Roast Choice]"]').val() == "Light Roast")
      $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Indonesia']").hide()
      else

      $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Indonesia']").show()



      $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option:selected").attr('disabled', 'disabled').siblings().removeAttr('disabled');
      );

      //second Origin Selection
      $('select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground [name="properties[Second Roast Choice]"]').change(function()
      if ($('select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground [name="properties[Second Origin Choice]"]').val() == 'Indonesia')
      $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").hide()
      else

      $("select.spb-productdescfont.spb-productoptiontextcolor.spb-productoptionbackground option[value = 'Light Roast']").show()

      );


      You will see the full code on codepen: https://codepen.io/jcssll/pen/eXwRzW
      Which as of just now is not working properly on Mac but the functionality of choosing the Indonesian origin and removing the Light Roast option value works well on my windows lap top.







      javascript jquery jquery-selectors shopify






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 0:36









      Joshua CassellJoshua Cassell

      11 bronze badge




      11 bronze badge

























          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55388521%2fwill-the-add-class-function-allow-me-to-create-more-specific-selectors-for-drop%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55388521%2fwill-the-add-class-function-allow-me-to-create-more-specific-selectors-for-drop%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해