Magento2.3 : How do I programmatically submit a form generated via a UIComponent?Right way to create butons in uiComponent form in Magento 2uiComponent Form. How to show data from DB tableuiComponent Form Save Button Not workingMagento 2.1 UI Component Image upload formDisplay an array of Jquery data in HTMLSubmit Form Button uiComponent Magento2Magento 2 Form UiComponent ExplainationSubmit Button in UIComponentCreate attribute programmatically in magento2.3Image Uploader throws Uncaught type Error in Ui Component
Python program to take in two strings and print the larger string
Grade-school elementary algebra presented in an abstract-algebra style?
Are black holes spherical during merger?
Why did the person in charge of a principality not just declare themself king?
Can my floppy disk still work without a shutter spring?
Do photons bend spacetime or not?
Is superuser the same as root?
便利な工具 what does な means
Does French have the English "short i" vowel?
Gravitational effects of a single human body on the motion of planets
includegraphics: get the "scale" value of a figure whose size is expressed by "width"
Is my plasma cannon concept viable?
Best material to absorb as much light as possible
Why does this if statement return true
How do I superimpose two math symbols?
Why isn't 'chemically-strengthened glass' made with potassium carbonate to begin with?
Are runways booked by airlines to land their planes?
Is the Unsullied name meant to be ironic? How did it come to be?
Why haven't we yet tried accelerating a space station with people inside to a near light speed?
Security vulnerabilities of POST over SSL
Is it possible to remotely hack the GPS system and disable GPS service worldwide?
Can a person survive on blood in place of water?
Is this statement about cut time correct?
The art of clickbait captions
Magento2.3 : How do I programmatically submit a form generated via a UIComponent?
Right way to create butons in uiComponent form in Magento 2uiComponent Form. How to show data from DB tableuiComponent Form Save Button Not workingMagento 2.1 UI Component Image upload formDisplay an array of Jquery data in HTMLSubmit Form Button uiComponent Magento2Magento 2 Form UiComponent ExplainationSubmit Button in UIComponentCreate attribute programmatically in magento2.3Image Uploader throws Uncaught type Error in Ui Component
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I created a UI Component form, but I am unable to find the element in the source.
I would like to click a button and then inspect a field in the form and dependent on what value is selected submit the form to a specific url.
In my uiComponent I have,
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Vendor_Module/js/ui/form/new_form</item>
</item>
Then I have the following code in Vendor_Module/js/ui/form/new_form:
define(
[
'jquery',
'Magento_Ui/js/form/form',
'mage/url'
],
function ($, form, url) {
'use strict';
return form.extend({
initialize: function ()
this._super();
$('#new_button').click(this.new_button);
return this;
,
new_button: function (redirect, data)
this.validate();
if (!this.additionalInvalid && !this.source.get('params.invalid'))
// CUSTOM CODE HERE BEFORE SUBMIT
this.setAdditionalData(data)
.submit(redirect);
else
this.focusInvalid();
I am currently getting,
Uncaught TypeError: this.validate is not a function
php javascript magento2.3 uicomponent ui-form
New contributor
add a comment |
I created a UI Component form, but I am unable to find the element in the source.
I would like to click a button and then inspect a field in the form and dependent on what value is selected submit the form to a specific url.
In my uiComponent I have,
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Vendor_Module/js/ui/form/new_form</item>
</item>
Then I have the following code in Vendor_Module/js/ui/form/new_form:
define(
[
'jquery',
'Magento_Ui/js/form/form',
'mage/url'
],
function ($, form, url) {
'use strict';
return form.extend({
initialize: function ()
this._super();
$('#new_button').click(this.new_button);
return this;
,
new_button: function (redirect, data)
this.validate();
if (!this.additionalInvalid && !this.source.get('params.invalid'))
// CUSTOM CODE HERE BEFORE SUBMIT
this.setAdditionalData(data)
.submit(redirect);
else
this.focusInvalid();
I am currently getting,
Uncaught TypeError: this.validate is not a function
php javascript magento2.3 uicomponent ui-form
New contributor
Can you please paste your code here? Thanks
– Shankar
May 18 at 5:47
@Shankar I have added the code as requested.
– Eugene Louw
May 19 at 18:57
add a comment |
I created a UI Component form, but I am unable to find the element in the source.
I would like to click a button and then inspect a field in the form and dependent on what value is selected submit the form to a specific url.
In my uiComponent I have,
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Vendor_Module/js/ui/form/new_form</item>
</item>
Then I have the following code in Vendor_Module/js/ui/form/new_form:
define(
[
'jquery',
'Magento_Ui/js/form/form',
'mage/url'
],
function ($, form, url) {
'use strict';
return form.extend({
initialize: function ()
this._super();
$('#new_button').click(this.new_button);
return this;
,
new_button: function (redirect, data)
this.validate();
if (!this.additionalInvalid && !this.source.get('params.invalid'))
// CUSTOM CODE HERE BEFORE SUBMIT
this.setAdditionalData(data)
.submit(redirect);
else
this.focusInvalid();
I am currently getting,
Uncaught TypeError: this.validate is not a function
php javascript magento2.3 uicomponent ui-form
New contributor
I created a UI Component form, but I am unable to find the element in the source.
I would like to click a button and then inspect a field in the form and dependent on what value is selected submit the form to a specific url.
In my uiComponent I have,
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Vendor_Module/js/ui/form/new_form</item>
</item>
Then I have the following code in Vendor_Module/js/ui/form/new_form:
define(
[
'jquery',
'Magento_Ui/js/form/form',
'mage/url'
],
function ($, form, url) {
'use strict';
return form.extend({
initialize: function ()
this._super();
$('#new_button').click(this.new_button);
return this;
,
new_button: function (redirect, data)
this.validate();
if (!this.additionalInvalid && !this.source.get('params.invalid'))
// CUSTOM CODE HERE BEFORE SUBMIT
this.setAdditionalData(data)
.submit(redirect);
else
this.focusInvalid();
I am currently getting,
Uncaught TypeError: this.validate is not a function
php javascript magento2.3 uicomponent ui-form
php javascript magento2.3 uicomponent ui-form
New contributor
New contributor
edited 2 days ago
Sarfaraj
414518
414518
New contributor
asked May 17 at 21:20
Eugene LouwEugene Louw
63
63
New contributor
New contributor
Can you please paste your code here? Thanks
– Shankar
May 18 at 5:47
@Shankar I have added the code as requested.
– Eugene Louw
May 19 at 18:57
add a comment |
Can you please paste your code here? Thanks
– Shankar
May 18 at 5:47
@Shankar I have added the code as requested.
– Eugene Louw
May 19 at 18:57
Can you please paste your code here? Thanks
– Shankar
May 18 at 5:47
Can you please paste your code here? Thanks
– Shankar
May 18 at 5:47
@Shankar I have added the code as requested.
– Eugene Louw
May 19 at 18:57
@Shankar I have added the code as requested.
– Eugene Louw
May 19 at 18:57
add a comment |
0
active
oldest
votes
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
);
);
Eugene Louw is a new contributor. Be nice, and check out our Code of Conduct.
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%2f275085%2fmagento2-3-how-do-i-programmatically-submit-a-form-generated-via-a-uicomponent%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
Eugene Louw is a new contributor. Be nice, and check out our Code of Conduct.
Eugene Louw is a new contributor. Be nice, and check out our Code of Conduct.
Eugene Louw is a new contributor. Be nice, and check out our Code of Conduct.
Eugene Louw is a new contributor. Be nice, and check out our Code of Conduct.
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%2f275085%2fmagento2-3-how-do-i-programmatically-submit-a-form-generated-via-a-uicomponent%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
Can you please paste your code here? Thanks
– Shankar
May 18 at 5:47
@Shankar I have added the code as requested.
– Eugene Louw
May 19 at 18:57