how to get value of selected option using jqueryHow to pass & get value to jquery use in magento?Magento 2 : How can I upload files of dynamically added file input fields in the adminproblem with using jqueryMagento 2 Add new field to Magento_User admin formError depending with fileuploader on text field validation while saving category in BOSet default values for a multiselect ui-componentMultiselect value does not rendered all previously selected valueMagento 2 Create new “Catalog Input Type for Store Owner” AttributeMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento 2 Fatal error when adding date field in admin form and save

Is swap gate equivalent to just exchanging the wire of the two qubits?

Fantasy game inventory — Ch. 5 Automate the Boring Stuff

Explicit song lyrics checker

Regex version of strip() - Ch. 7 Automate the Boring Stuff

Weird thing in 737 cabin

Does knowing the surface area of all faces uniquely determine a tetrahedron?

Definition of 'vrit'

How did the European Union reach the figure of 3% as a maximum allowed deficit?

Fibonacci sequence and other metallic sequences emerged in the form of fractions

Fill the maze with a wall-following Snake until it gets stuck

Why can't I craft scaffolding in Minecraft 1.14?

Are there examples of rowers who also fought?

How much steel armor can you wear and still be able to swim?

What is the precise meaning of "подсел на мак"?

How useful is the GRE Exam?

Derivation of CDF of a function that results in an exponential distribution

Is there any possible way to get these hearts as Adult Link?

How can I ping multiple IP addresses at the same time?

In the US, can a former president run again?

Simplify, equivalent for (p ∨ ¬q) ∧ (¬p ∨ ¬q)

How do credit card companies know what type of business I'm paying for?

Is there a polite way to ask about one's ethnicity?

Is this broken pipe the reason my freezer is not working? Can it be fixed?

Justifying Affordable Bespoke Spaceships



how to get value of selected option using jquery


How to pass & get value to jquery use in magento?Magento 2 : How can I upload files of dynamically added file input fields in the adminproblem with using jqueryMagento 2 Add new field to Magento_User admin formError depending with fileuploader on text field validation while saving category in BOSet default values for a multiselect ui-componentMultiselect value does not rendered all previously selected valueMagento 2 Create new “Catalog Input Type for Store Owner” AttributeMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento 2 Fatal error when adding date field in admin form and save






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








1















I need to get selected value from select field using jquery in magento



<field name="slider_location">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="component" xsi:type="string">Vendor_Modulename/js/form/element/containers</item>
<item name="dataType" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Display On</item>
<item name="formElement" xsi:type="string">select</item>
<item name="visible" xsi:type="boolean">true</item>
<item name="dataScope" xsi:type="string">slider_location</item>
</item>
</argument>
</field>









share|improve this question
























  • i think your datatype must be select

    – Rk Rathod
    Jun 10 at 9:35











  • i added <item name="formElement" xsi:type="string">select</item>

    – Waqar Ali
    Jun 10 at 9:47

















1















I need to get selected value from select field using jquery in magento



<field name="slider_location">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="component" xsi:type="string">Vendor_Modulename/js/form/element/containers</item>
<item name="dataType" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Display On</item>
<item name="formElement" xsi:type="string">select</item>
<item name="visible" xsi:type="boolean">true</item>
<item name="dataScope" xsi:type="string">slider_location</item>
</item>
</argument>
</field>









share|improve this question
























  • i think your datatype must be select

    – Rk Rathod
    Jun 10 at 9:35











  • i added <item name="formElement" xsi:type="string">select</item>

    – Waqar Ali
    Jun 10 at 9:47













1












1








1








I need to get selected value from select field using jquery in magento



<field name="slider_location">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="component" xsi:type="string">Vendor_Modulename/js/form/element/containers</item>
<item name="dataType" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Display On</item>
<item name="formElement" xsi:type="string">select</item>
<item name="visible" xsi:type="boolean">true</item>
<item name="dataScope" xsi:type="string">slider_location</item>
</item>
</argument>
</field>









share|improve this question
















I need to get selected value from select field using jquery in magento



<field name="slider_location">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="component" xsi:type="string">Vendor_Modulename/js/form/element/containers</item>
<item name="dataType" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Display On</item>
<item name="formElement" xsi:type="string">select</item>
<item name="visible" xsi:type="boolean">true</item>
<item name="dataScope" xsi:type="string">slider_location</item>
</item>
</argument>
</field>






magento2 php jquery






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 10 at 9:44









Shan Atif

15814




15814










asked Jun 10 at 9:29









Waqar AliWaqar Ali

11011




11011












  • i think your datatype must be select

    – Rk Rathod
    Jun 10 at 9:35











  • i added <item name="formElement" xsi:type="string">select</item>

    – Waqar Ali
    Jun 10 at 9:47

















  • i think your datatype must be select

    – Rk Rathod
    Jun 10 at 9:35











  • i added <item name="formElement" xsi:type="string">select</item>

    – Waqar Ali
    Jun 10 at 9:47
















i think your datatype must be select

– Rk Rathod
Jun 10 at 9:35





i think your datatype must be select

– Rk Rathod
Jun 10 at 9:35













i added <item name="formElement" xsi:type="string">select</item>

– Waqar Ali
Jun 10 at 9:47





i added <item name="formElement" xsi:type="string">select</item>

– Waqar Ali
Jun 10 at 9:47










1 Answer
1






active

oldest

votes


















0














You can simply get it with the select name attribute



$('select[name=general[slider_location]]').val();


Note: general → is the fieldset name, change it accordingly.



You can bind the it on change event:



$(document).ready(function()
$('select[name="slider_details[slider_location]"]').change(function()
alert( this.value );
);
);





share|improve this answer

























  • i added jQuery('select[name=slider_details[slider_location]]').val(); got a console error syntax error, unrecognized expression: select[name=slider_details[slider_location]]

    – Waqar Ali
    Jun 10 at 9:57











  • try like $('select[name="slider_details[slider_location]"]').val();

    – fmsthird
    Jun 10 at 10:05












  • i want to get value in initalize function there it is not working otherwise its working well

    – Waqar Ali
    Jun 10 at 11:04











  • can you check updated answer

    – fmsthird
    Jun 10 at 11:35











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2fmagento.stackexchange.com%2fquestions%2f277792%2fhow-to-get-value-of-selected-option-using-jquery%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You can simply get it with the select name attribute



$('select[name=general[slider_location]]').val();


Note: general → is the fieldset name, change it accordingly.



You can bind the it on change event:



$(document).ready(function()
$('select[name="slider_details[slider_location]"]').change(function()
alert( this.value );
);
);





share|improve this answer

























  • i added jQuery('select[name=slider_details[slider_location]]').val(); got a console error syntax error, unrecognized expression: select[name=slider_details[slider_location]]

    – Waqar Ali
    Jun 10 at 9:57











  • try like $('select[name="slider_details[slider_location]"]').val();

    – fmsthird
    Jun 10 at 10:05












  • i want to get value in initalize function there it is not working otherwise its working well

    – Waqar Ali
    Jun 10 at 11:04











  • can you check updated answer

    – fmsthird
    Jun 10 at 11:35















0














You can simply get it with the select name attribute



$('select[name=general[slider_location]]').val();


Note: general → is the fieldset name, change it accordingly.



You can bind the it on change event:



$(document).ready(function()
$('select[name="slider_details[slider_location]"]').change(function()
alert( this.value );
);
);





share|improve this answer

























  • i added jQuery('select[name=slider_details[slider_location]]').val(); got a console error syntax error, unrecognized expression: select[name=slider_details[slider_location]]

    – Waqar Ali
    Jun 10 at 9:57











  • try like $('select[name="slider_details[slider_location]"]').val();

    – fmsthird
    Jun 10 at 10:05












  • i want to get value in initalize function there it is not working otherwise its working well

    – Waqar Ali
    Jun 10 at 11:04











  • can you check updated answer

    – fmsthird
    Jun 10 at 11:35













0












0








0







You can simply get it with the select name attribute



$('select[name=general[slider_location]]').val();


Note: general → is the fieldset name, change it accordingly.



You can bind the it on change event:



$(document).ready(function()
$('select[name="slider_details[slider_location]"]').change(function()
alert( this.value );
);
);





share|improve this answer















You can simply get it with the select name attribute



$('select[name=general[slider_location]]').val();


Note: general → is the fieldset name, change it accordingly.



You can bind the it on change event:



$(document).ready(function()
$('select[name="slider_details[slider_location]"]').change(function()
alert( this.value );
);
);






share|improve this answer














share|improve this answer



share|improve this answer








edited Jun 10 at 11:35

























answered Jun 10 at 9:53









fmsthirdfmsthird

3,3884631




3,3884631












  • i added jQuery('select[name=slider_details[slider_location]]').val(); got a console error syntax error, unrecognized expression: select[name=slider_details[slider_location]]

    – Waqar Ali
    Jun 10 at 9:57











  • try like $('select[name="slider_details[slider_location]"]').val();

    – fmsthird
    Jun 10 at 10:05












  • i want to get value in initalize function there it is not working otherwise its working well

    – Waqar Ali
    Jun 10 at 11:04











  • can you check updated answer

    – fmsthird
    Jun 10 at 11:35

















  • i added jQuery('select[name=slider_details[slider_location]]').val(); got a console error syntax error, unrecognized expression: select[name=slider_details[slider_location]]

    – Waqar Ali
    Jun 10 at 9:57











  • try like $('select[name="slider_details[slider_location]"]').val();

    – fmsthird
    Jun 10 at 10:05












  • i want to get value in initalize function there it is not working otherwise its working well

    – Waqar Ali
    Jun 10 at 11:04











  • can you check updated answer

    – fmsthird
    Jun 10 at 11:35
















i added jQuery('select[name=slider_details[slider_location]]').val(); got a console error syntax error, unrecognized expression: select[name=slider_details[slider_location]]

– Waqar Ali
Jun 10 at 9:57





i added jQuery('select[name=slider_details[slider_location]]').val(); got a console error syntax error, unrecognized expression: select[name=slider_details[slider_location]]

– Waqar Ali
Jun 10 at 9:57













try like $('select[name="slider_details[slider_location]"]').val();

– fmsthird
Jun 10 at 10:05






try like $('select[name="slider_details[slider_location]"]').val();

– fmsthird
Jun 10 at 10:05














i want to get value in initalize function there it is not working otherwise its working well

– Waqar Ali
Jun 10 at 11:04





i want to get value in initalize function there it is not working otherwise its working well

– Waqar Ali
Jun 10 at 11:04













can you check updated answer

– fmsthird
Jun 10 at 11:35





can you check updated answer

– fmsthird
Jun 10 at 11:35

















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • 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%2fmagento.stackexchange.com%2fquestions%2f277792%2fhow-to-get-value-of-selected-option-using-jquery%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

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?