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;
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
add a comment |
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
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
add a comment |
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
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
magento2 php jquery
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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 );
);
);
i addedjQuery('select[name=slider_details[slider_location]]').val();
got a console errorsyntax 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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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 );
);
);
i addedjQuery('select[name=slider_details[slider_location]]').val();
got a console errorsyntax 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
add a comment |
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 );
);
);
i addedjQuery('select[name=slider_details[slider_location]]').val();
got a console errorsyntax 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
add a comment |
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 );
);
);
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 );
);
);
edited Jun 10 at 11:35
answered Jun 10 at 9:53
fmsthirdfmsthird
3,3884631
3,3884631
i addedjQuery('select[name=slider_details[slider_location]]').val();
got a console errorsyntax 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
add a comment |
i addedjQuery('select[name=slider_details[slider_location]]').val();
got a console errorsyntax 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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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