-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: added realtime client side validation on checkout form inputs #27
base: main
Are you sure you want to change the base?
Conversation
Hey @Ankesh2004 can you please add a screen recording of how validations will work covering all edge cases along with the screenshot you have provided. |
Hey @Ankesh2004 Any updates. |
); | ||
} | ||
} | ||
add_action('wp_enqueue_scripts', 'enqueue_checkout_validation_script'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add_action('wp_enqueue_scripts', 'enqueue_checkout_validation_script'); | |
add_action( 'wp_enqueue_scripts', 'enqueue_checkout_validation_script' ); |
console.error('Place Order button not found'); | ||
return; | ||
} | ||
console.log('Place Order button found'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log('Place Order button found'); |
if (!form) { | ||
console.error('Checkout form not found'); | ||
return; | ||
} | ||
console.log('Checkout form found'); | ||
|
||
if (!placeOrderButton) { | ||
console.error('Place Order button not found'); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!form) { | |
console.error('Checkout form not found'); | |
return; | |
} | |
console.log('Checkout form found'); | |
if (!placeOrderButton) { | |
console.error('Place Order button not found'); | |
return; | |
} |
if (!emailField || !firstNameField || !lastNameField || !zipCodeField || !phoneField) { | ||
console.error('One or more form fields not found'); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!emailField || !firstNameField || !lastNameField || !zipCodeField || !phoneField) { | |
console.error('One or more form fields not found'); | |
return; | |
} |
This is good work |
Type of Change
Description
Adds realtime input validations on checkout page.
Additional Changes
checkout-validation.js
in js folder.hyperswitch-checkout.php
Motivation and Context
Fixes issue juspay/hyperswitch#6169
How did you test it?
Locally tested