Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $fieldset->addField(
- 'email_from',
- 'text',
- ['name' => 'email_from', 'label' => __('Email From'), 'title' => __('Email From'), 'required' => true, 'class' => 'validate-email']
- );
- min_text_length
- max_text_length
- max-words
- min-words
- range-words
- letters-with-basic-punc
- alphanumeric
- letters-only
- no-whitespace
- zip-range
- integer
- vinUS
- dateITA
- dateNL
- time
- time12h
- phoneUS
- phoneUK
- mobileUK
- stripped-min-length
- email2
- url2
- credit-card-types
- ipv4
- ipv6
- pattern
- validate-no-html-tags
- validate-select
- validate-no-empty
- validate-alphanum-with-spaces
- validate-data
- validate-street
- validate-phoneStrict
- validate-phoneLax
- validate-fax
- validate-email
- validate-emailSender
- validate-password
- validate-admin-password
- validate-url
- validate-clean-url
- validate-xml-identifier
- validate-ssn
- validate-zip-us
- validate-date-au
- validate-currency-dollar
- validate-not-negative-number
- validate-zero-or-greater
- validate-greater-than-zero
- validate-css-length
- validate-number
- validate-number-range
- validate-digits
- validate-digits-range
- validate-range
- validate-alpha
- validate-code
- validate-alphanum
- validate-date
- validate-identifier
- validate-zip-international
- validate-state
- less-than-equals-to
- greater-than-equals-to
- validate-emails
- validate-cc-number
- validate-cc-ukss
- required-entry
- checked
- not-negative-amount
- validate-per-page-value-list
- validate-new-password
- validate-item-quantity
- equalTo
- <form class="form" id="custom-form" method="post" autocomplete="off">
- <fieldset class="fieldset">
- <legend class="legend"><span><?php echo __('Personal Information') ?></span></legend><br>
- <div class="field required">
- <label for="email_address" class="label"><span><?php echo __('Email') ?></span></label>
- <div class="control">
- <input type="email" name="email" id="email_address" value="" title="<?php echo __('Email') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}">
- </div>
- </div>
- </fieldset>
- <div class="actions-toolbar">
- <div class="primary">
- <button type="submit" class="action submit primary" title="<?php echo __('Submit') ?>"><span><?php echo __('Submit') ?></span></button>
- </div>
- </div>
- </form>
- <script type="text/x-magento-init">
- {
- "#custom-form": {
- "validation": {}
- }
- }
- </script>
- <form data-mage-init='{"validation": {}}' class="form" id="custom-form" method="post" autocomplete="off">
- <script type="text/javascript">
- require([
- 'jquery',
- 'mage/mage'
- ], function($){
- var dataForm = $('#custom-form');
- dataForm.mage('validation', {});
- });
- </script>
- <script>
- require([
- 'jquery',
- 'mage/mage'
- ], function($){
- var dataForm = $('#form-validate');
- var ignore = null;
- dataForm.mage('validation', {
- ignore: ignore ? ':hidden:not(' + ignore + ')' : ':hidden'
- }).find('input:text').attr('autocomplete', 'off');
- });
- </script>
- <!-- form tag -->
- <form class="form" id="custom-form-id" method="post" autocomplete="off">
- <fieldset class="fieldset">
- <legend class="legend"><span><?php echo __('User Personal Information') ?></span></legend><br>
- <div class="field required">
- <!-- form field -->
- <label for="email_address" class="label"><span><?php echo __('Email') ?></span></label>
- <div class="control">
- <input type="email" name="email" id="email_address" value="" title="<?php echo __('Email') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}">
- </div>
- </div>
- </fieldset>
- <!-- submit button -->
- <div class="actions-toolbar">
- <div class="primary">
- <button type="submit" class="action submit primary" title="<?php echo __('Submit') ?>"><span><?php echo __('Submit') ?></span></button>
- </div>
- </div>
- </form>
- <!-- enable javascript validation for custom-form-id -->
- <script type="text/x-magento-init">
- {
- "#custom-form-id": {
- "validation": {}
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement