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

Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

Log in Navigation menu

Invalid response line returned from server: HTTP/2 401 | ErrorPlease Please Help With Error 500 Internal Server Error after upgrading from 1.7 to 1.9Unable to place new customer orders in admin backendMagento - For “Manage Categories” Forbidden You do not have permission to access this documentHTTP ERROR 500 when using require(_once) app/Mage.phpMemcached causing Web Setup Wizard ErrorCould not create an acl object: Invalid XMLAn error occurred on the server. Please try to place the order againInvalid response line returned from server: HTTP/2 200 - message after update to 2.1.7Magento-CE 2.3.0 installation error on XamppMagento 2.2.6- After Migration all default Payment Methods are not working fine