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

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form