Questions tagged [forms]

Denotes questions about forms in Magento (admin forms, frontend forms, management)

216 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9 votes
2 answers
4k views

Magento 2 : Validate form fields that are loaded with Knockout on blur-event

I have a form that is generated through a .phtml file, and in this form various fields are loaded with KnockOut (using the uiComponent javascript-object). .phtml: <form action="#" class="form ...
  • 11.9k
7 votes
2 answers
668 views

How to add a star rating in custom form in magento 2

I have created the feedback form in list page. Now I wish to add custom star rating as a new form field. Please suggest any solution to add rating field in my form.
  • 2,468
7 votes
1 answer
5k views

How can we create a form at front-end using UI component Magento 2

I am looking to create a form at storefront using UI component. When I create xml file in Ui component folder It throwing an error Fatal error: Call to a member function getRequestFieldName() on ...
6 votes
1 answer
853 views

How to create Dynamic rows in custom admin form?

I want to create a form field which has dynamic rows in that page. Also, I want to store the form data in database table. I already referred this link >> https://github.com/bbakalovGlobal/...
5 votes
0 answers
3k views

Magento2: Adding custom fields on checkout are not associated with the form

I'm trying to add some custom fields on the checkout. I looked around the internet and always I found an example adding some information on shipping address. But what I want is a fieldset independent ...
  • 1,433
4 votes
1 answer
85 views

Custom Page Form and db insertion magento 2

I have created a custom Form and try to store details in databse. but the product url field and image url is not saved in db. app/code/Dyode/Pricebeat/Controller/User/Post.php <?php namespace ...
4 votes
0 answers
755 views

Magento 2.1: Adding Custom Css to Admin Ui Component Form

I invested a couple of hours to get a solution to figure out , that how can we customize the M2 admin form - for the sake of clarity please see the below screenshot: The default admin form fieldsets ...
  • 1,722
4 votes
1 answer
1k views

Magento 2 - Add tree category selector on backend module

I'm trying to create my custom form on a backend module, I need to allow the admin to select some categories, so I wanted to use the magento standard category selector, well I add my field in this way:...
3 votes
0 answers
282 views

Magento 2.2.3 Vat-Id Field not showing Shipping or Billing Address

I have enabled the Show Vat number option in the frontend, but the Vat-Id field is only displayed on the sign-up form. I can not add the VAT number on the shipping or billing address forms on the ...
3 votes
1 answer
300 views

Customize Account setting form in Magento 2

In Magento 2, the previous Account Setting edit form has a different layout, like for changing password user has to select the checkbox and then text boxes for password updates pop up, I am changing ...
  • 819
3 votes
1 answer
3k views

Make required field to Gift Option in Magento 2

I enable gift option from magento 2 admin. Now i want to make required. field on cart page. I found that template is coming from vendor/magento/module-gift-message/view/frontend/web/template/gift-...
  • 729
3 votes
0 answers
150 views

How to save/select a custom phml form in DB on Magento 2

I have created a custom module, and i have this phtml: <div class="container-club"> <h2>test<h2> <div class="club-img"> </div> <div class="club-...
  • 2,632
3 votes
0 answers
794 views

What is the proper format for checkbox validation in Magento 2?

Using 2.1.5, I have a custom front end form with a set of text elements built (roughly) as: <div class="field my-field required"> <label class="label" for="my-field">My Field:</...
  • 714
3 votes
0 answers
787 views

How to add input form to custom checkout step in magento 2

I created new checkout step in magento 2 using this link custom checkot step Now I have only a button on my new step which is declared here in mystep.html <!--The 'step_code' value from the .js ...
  • 2,632
2 votes
0 answers
28 views

Hide tab on custom form switching select values

I'm working on building a custom form where i need to show and hide other tabs of other form based on a select Value, So pretty much i want, when switching on the second value to hide the second tab ...
2 votes
0 answers
677 views

Magento 2 : make a multiple step register form

I want to make a multiple-step register form in Magento 2. How can I do it? Any helps? Thank in advance.
  • 651
2 votes
0 answers
76 views

in custom module ajax-loading form translations not working magento 2.3

in ajax-loading form Change English it to italiano and it works but italiano to English not working proper. once transalte to italiano then switch to english store not transalte to english ...
  • 2,250
2 votes
1 answer
395 views

Magento 2.1.7 - Unable to send form data to controller using AJAX

I am trying to fetch input value but I am unable to get values in the controller. Here is my code, Controller\Index\Index.php <?php namespace Crud\Crudatfrontend\Controller\Index; class Index ...
2 votes
1 answer
239 views

What is the use of getFormActionUrl()?

In Magento2.1.10 I am trying to make admin grid module and found below function in given path \app\code\xyz\Grid\Block\Adminhtml\Grid\addrow.php public function getFormActionUrl(){ if ($...
2 votes
2 answers
64 views

form not showing when i click on menu

form not showing when I click on the menu that I created custom module. Here's my code: /home1/dukaania/public_html/testing2/app/code/Test/Banners/etc/adminhtml/menu.xml <?xml version="1.0"?&...
2 votes
3 answers
3k views

How can I create custom form in Magento 2?

I want to create custom form for support in my Magento 2 website So how can I achieve this with the use of only one file(.phtml)? (All html and php code should be in one file) It means I want to ...
2 votes
0 answers
56 views

We were unable to submit your request. Please try again! in Magento 2?

I have created the custom page and tried submitting form. I am getting below error "We were unable to submit your request. Please try again!". Below is code for contoller use Magento\Framework\...
  • 1,799
2 votes
0 answers
2k views

Magento2: How to create a Ui Component Form in the storefront

I am trying to create a form using Ui Components in the storefront. For that I have created the following: A Layout: that I used to call the Form Component. <!-- magento/app/code/Vendor/...
  • 2,285
2 votes
0 answers
193 views

UI component form with a foreign key value

I'm trying to do a admin form for a custom model, this model has 3 foreign key columns, I using UI component for this, but i haven't got idea. For example, this model has a order_id column, i'm ...
2 votes
0 answers
125 views

make form for upload the receipt for bank transfer

I hope you are having a great day. I want to ask how to make a form to let customer to upload the receipts (image) of transfer the money. thank you. magento 1.9
  • 87
2 votes
1 answer
3k views

How to add a input mask on any checkout field?

I've been searching for a way to adds masks in some checkout input fields, I found this, but without answers, I want to add pt_BR mask on the telephone field. Is there some way to use Jquery Mask ...
  • 681
2 votes
1 answer
1k views

Payment method with custom form in Knockout js

I've created a custom payment method successfully in Magento2. When this custom payment method selected, I need a form to display a text field and submit button that will hit some AJAX Api's using in ...
2 votes
0 answers
126 views

Prevent files from being uploaded after the UiComponent's ajax file upload

I'm currently implementing the UiComponent's Form Component, which has a section on using file uploads. You can define the file upload path and after selecting a file in your form, an AJAX call is ...
  • 152
2 votes
0 answers
204 views

Add custom form in magento create order page

How do I add a custom form in the magento create order page like the following ?
2 votes
0 answers
584 views

Magento 2: Form xml default value

I have the following form element which gets a list of products and adds them to a select form element <field name="featuredproduct"> <argument name="data" xsi:type="array"> ...
  • 31
2 votes
0 answers
214 views

Magento 2 : Forms in Frontend

I needed to create configuration form in Magento2 admin. After research, I found that forms had to be defined in xml (system.xml) <group id="general" translate="label" type="text" sortOrder="...
  • 1,645
2 votes
0 answers
76 views

Magento 2 : I have add new field to cusotmer group but value not save

I have add new custom fields to customer group (adminhtml) but value not save. For add new field into customer group I have override below file: Block/Adminhtml/Group/Edit/Form.php $form = $this-...
2 votes
0 answers
889 views

Magento 2 : How to Add wysiwyg Editor in Frontend Custom Form

I wanted to create WYSIWYG editor in custom form frontend. What I tried doing is : Created WysiwygConfig.php file inside Vendor/Extension/Plugin directory with code : class WysiwygConfig { ...
2 votes
0 answers
30 views

Recommendations for A/B Testings a block/template

I have a form on my site for customers to request a quote on a product. The form is stored in a template file. I want to test two versions of this form. One form would ask the user to enter their ...
2 votes
1 answer
697 views

Magento 2: Remove Checkout Options

How do I remove the (required) Phone Number input from the Checkout page? I don't need my customers to enter their number and don't want it to put them off from checking out.
  • 1,317
2 votes
0 answers
202 views

URL to my module with adminhtml controller

I added a form to customer page from backend. How do I create the URL for action attribute to a certain function ( public function editAction(){...} )? Function that is founded in app/code/local/...
2 votes
0 answers
177 views

input_renderer does not come in action - Widget_Form

Taking example from this link http://inchoo.net/magento/adding-magento-attribute-with-custom-input-renderer/ I create my renderer and associate it to a attribute in setup.php file: ...
  • 45
2 votes
0 answers
726 views

How to display Custom Attribute in Registration Form

I wont to display custom drop down in customer form, my sql.php $installer = $this; $installer->startSetup(); $installer->addAttribute("customer", "how", array( "type" => "...
  • 121
2 votes
1 answer
630 views

Add text to dropdown list of country options billing checkout form

I would like to display the shipping costs in my dropdown list of countries (shipping) options. Preferably through a php request, as follows: Guessing I need to add to/or modify this piece in my ...
  • 515
1 vote
0 answers
387 views

Magento2 - When I enable google recaptcha it returns an error when submitting the form

In my site with Magento 2.4.2 I have enabled google recaptcha v2 invisible on the registration form and contact us. The problem is that when I try to register or submit the form on the contact page I ...
  • 347
1 vote
0 answers
13 views

Magento 2 | Launch an action form in the order view of the backend

I am trying to launch an action form for uploading some attachments and staying on the same page in the order view section of the Magento backend. My code for now is this but it doesn't work, the form ...
  • 347
1 vote
0 answers
103 views

How to store category id and also category name in custom table two different entity in magento 2?

How to Store category id and also Store category name in custom table two entity public function toOptionArray() { $options = []; $categories = $this->collectionFactory->...
1 vote
0 answers
85 views

Magento 2 - Save data of customer from a form in database

I wish I could create a form with several inputs dedicated to the customer's attributes in my first custom checkout step. This form will have to save the data in the database, in the customer ...
  • 347
1 vote
0 answers
262 views

How to get Data of a UI Component Admin Form and use it in Controller?

So i'm creating a UI Component Admin Form with a few fields, and one of them is a Dropdown field. I want to get the value that user selects, using a custom controller that i made. I tried this comands:...
1 vote
0 answers
104 views

Custom Form Call using CMS page will not show Magento 2 Captcha code

When i call form using direct URL http://192.168.1.35/m234/customemail/index/index OR http://192.168.1.35/m234/customemail/ it will show Captcha code but when i call this same form using CMS page like ...
1 vote
0 answers
33 views

Invalid form key on admin login

Attempting to get a magento 1.14 site setup in Vagrant. Store seems to be loading correctly, I'm able to view the frontend, admin login screen and n98magerun let's me edit conglfigs, clear caches ...
1 vote
1 answer
51 views

duplicated tab in form Magento 2

$fieldset->addField('media_gallery', 'note', [ 'label' => '', 'title' => __('Media Gallery'), 'name' => 'media_gallery', // '...
  • 651
1 vote
0 answers
80 views

Add file type to data persistor

I have a custom form that has a input type file everything works fine except for the data persistor. Its working for text input types where you can just insert the request params in the data persistor....
1 vote
3 answers
55 views

How to redirect page to cms page ie.(carrer.html) via controller file?

Mage::getSingleton('core/session')->addSuccess('Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.'); $this->_redirect('*/*/'); return;
1 vote
1 answer
98 views

Add custom Form to Review and Payments page

There are many examples online about adding a custom form with custom fields to the shipping-step, but I would like to know how to add a custom form with fields to the billing-step page.

1
2 3 4 5