LightBlue82 Posted November 6 Share Posted November 6 Hello, i would like to add a required field (-must add purchase date) to my Complain Ticket side, is this possible? thank you BL Link to comment Share on other sites More sharing options...
Knowband Plugins Posted November 7 Share Posted November 7 Find the template file for the complaint form, typically located in the module's views/templates/front/ folder or under the theme’s template files. <div class="form-group"> <label for="purchase_date">Purchase Date</label> <input type="date" id="purchase_date" name="purchase_date" required> </div> Adding required in the HTML will make it mandatory in the front end. In the controller that processes the complaint form submission (usually a ModuleFrontController file in the module folder), add validation for the "Purchase Date" field. if (empty(Tools::getValue('purchase_date'))) { $this->errors[] = $this->module->l('Purchase Date is required.'); } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now