我在注册页面中创建了确认密码字段,但由于 G-challenge 面临问题,因为在提交表单后 shopify 重定向到挑战页面,并且我用于确认密码的 js 不起作用。
<input type="password" name="customer[password]" id="CreatePassword" class="{% if form.errors contains 'password' %} error{% endif %}" required>
<input type="password" value="" name="customer[password_confirmation]" id="confirm-password" class="password text {% if form.errors contains 'password' %} error{% endif %}" size="30" required/>
$(function(){
$('form#create_customer').submit(function(e) {
e.preventDefault();
if ( $('#CreatePassword').val() != $('#confirm-password').val()) {
alert('Passwords do not match.');
} else {
$('form#create_customer').submit();
}
});
});