Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form validation attributes #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Form validation attributes
  • Loading branch information
Ilan Parmentier authored Feb 1, 2022
commit 766e7f51a291db8e000ea2e2e77f1e6814664a89
20 changes: 8 additions & 12 deletions view/frontend/templates/customer/lookupform.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
/** @var $block MagePal\GuestToCustomer\Block\Customer\LookupForm */
?>

<form class="form form-edit-account" action="<?= $block->escapeUrl($block->getUrl('customer/guesttocustomer/lookupformPost')) ?>" method="post" id="form-validate" data-hasrequired="<?= $block->escapeHtmlAttr(__('* Required Fields')) ?>" autocomplete="off">
<form class="form form-edit-account"
action="<?= $block->escapeUrl($block->getUrl('customer/guesttocustomer/lookupformPost')) ?>"
method="post"
id="form-validate"
data-mage-init='{"validation": {}}'
data-hasrequired="<?= $block->escapeHtmlAttr(__('* Required Fields')) ?>"
autocomplete="off">
<fieldset class="fieldset info">
<?= $block->getBlockHtml('formkey') ?>
<legend class="legend"><span><?= $block->escapeHtml(__('Guest Order Information')) ?></span></legend><br>
Expand All @@ -33,6 +39,7 @@
</fieldset>

<?= $block->getChildHtml('form_additional_info') ?>

<div class="actions-toolbar">
<div class="primary">
<button type="submit" class="action save primary" title="<?= $block->escapeHtmlAttr(__('Save')) ?>"><span><?= $block->escapeHtml(__('Save')) ?></span></button>
Expand All @@ -42,14 +49,3 @@
</div>
</div>
</form>
<script>
require([
"jquery",
"mage/mage"
], function($){
var dataForm = $('#form-validate');

dataForm.mage('validation', {});

});
</script>