Advertisement
Guest User

Untitled

a guest
Sep 5th, 2017
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. $fieldset->addField(
  2. 'email_from',
  3. 'text',
  4. ['name' => 'email_from', 'label' => __('Email From'), 'title' => __('Email From'), 'required' => true, 'class' => 'validate-email']
  5. );
  6.  
  7. min_text_length
  8. max_text_length
  9. max-words
  10. min-words
  11. range-words
  12. letters-with-basic-punc
  13. alphanumeric
  14. letters-only
  15. no-whitespace
  16. zip-range
  17. integer
  18. vinUS
  19. dateITA
  20. dateNL
  21. time
  22. time12h
  23. phoneUS
  24. phoneUK
  25. mobileUK
  26. stripped-min-length
  27. email2
  28. url2
  29. credit-card-types
  30. ipv4
  31. ipv6
  32. pattern
  33. validate-no-html-tags
  34. validate-select
  35. validate-no-empty
  36. validate-alphanum-with-spaces
  37. validate-data
  38. validate-street
  39. validate-phoneStrict
  40. validate-phoneLax
  41. validate-fax
  42. validate-email
  43. validate-emailSender
  44. validate-password
  45. validate-admin-password
  46. validate-url
  47. validate-clean-url
  48. validate-xml-identifier
  49. validate-ssn
  50. validate-zip-us
  51. validate-date-au
  52. validate-currency-dollar
  53. validate-not-negative-number
  54. validate-zero-or-greater
  55. validate-greater-than-zero
  56. validate-css-length
  57. validate-number
  58. validate-number-range
  59. validate-digits
  60. validate-digits-range
  61. validate-range
  62. validate-alpha
  63. validate-code
  64. validate-alphanum
  65. validate-date
  66. validate-identifier
  67. validate-zip-international
  68. validate-state
  69. less-than-equals-to
  70. greater-than-equals-to
  71. validate-emails
  72. validate-cc-number
  73. validate-cc-ukss
  74. required-entry
  75. checked
  76. not-negative-amount
  77. validate-per-page-value-list
  78. validate-new-password
  79. validate-item-quantity
  80. equalTo
  81.  
  82. <form class="form" id="custom-form" method="post" autocomplete="off">
  83. <fieldset class="fieldset">
  84. <legend class="legend"><span><?php echo __('Personal Information') ?></span></legend><br>
  85. <div class="field required">
  86. <label for="email_address" class="label"><span><?php echo __('Email') ?></span></label>
  87. <div class="control">
  88. <input type="email" name="email" id="email_address" value="" title="<?php echo __('Email') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}">
  89. </div>
  90. </div>
  91. </fieldset>
  92. <div class="actions-toolbar">
  93. <div class="primary">
  94. <button type="submit" class="action submit primary" title="<?php echo __('Submit') ?>"><span><?php echo __('Submit') ?></span></button>
  95. </div>
  96. </div>
  97. </form>
  98.  
  99. <script type="text/x-magento-init">
  100. {
  101. "#custom-form": {
  102. "validation": {}
  103. }
  104. }
  105. </script>
  106.  
  107. <form data-mage-init='{"validation": {}}' class="form" id="custom-form" method="post" autocomplete="off">
  108.  
  109. <script type="text/javascript">
  110. require([
  111. 'jquery',
  112. 'mage/mage'
  113. ], function($){
  114.  
  115. var dataForm = $('#custom-form');
  116. dataForm.mage('validation', {});
  117.  
  118. });
  119. </script>
  120.  
  121. <script>
  122. require([
  123. 'jquery',
  124. 'mage/mage'
  125. ], function($){
  126.  
  127. var dataForm = $('#form-validate');
  128. var ignore = null;
  129.  
  130. dataForm.mage('validation', {
  131. ignore: ignore ? ':hidden:not(' + ignore + ')' : ':hidden'
  132. }).find('input:text').attr('autocomplete', 'off');
  133.  
  134. });
  135. </script>
  136.  
  137. <!-- form tag -->
  138. <form class="form" id="custom-form-id" method="post" autocomplete="off">
  139. <fieldset class="fieldset">
  140. <legend class="legend"><span><?php echo __('User Personal Information') ?></span></legend><br>
  141. <div class="field required">
  142. <!-- form field -->
  143. <label for="email_address" class="label"><span><?php echo __('Email') ?></span></label>
  144. <div class="control">
  145. <input type="email" name="email" id="email_address" value="" title="<?php echo __('Email') ?>" class="input-text" data-validate="{required:true, 'validate-email':true}">
  146. </div>
  147. </div>
  148. </fieldset>
  149. <!-- submit button -->
  150. <div class="actions-toolbar">
  151. <div class="primary">
  152. <button type="submit" class="action submit primary" title="<?php echo __('Submit') ?>"><span><?php echo __('Submit') ?></span></button>
  153. </div>
  154. </div>
  155. </form>
  156.  
  157. <!-- enable javascript validation for custom-form-id -->
  158. <script type="text/x-magento-init">
  159. {
  160. "#custom-form-id": {
  161. "validation": {}
  162. }
  163. }
  164. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement