我需要在提交驗證後禁用或在表單上放置加載圖像。任何一個爲我工作。點擊一次後,我找到了許多禁用「提交」按鈕的方法,但這並沒有考慮到驗證錯誤。在Magento驗證後點擊一次後禁用提交按鈕
我試圖以許多不同的方式來看這個,但我似乎無法找到有效的東西。
我使用Magento在當前窗體上使用的默認原型表單。
這是我目前有:
var contactForm = new VarienForm('productcontactForm', true);
contactForm.submit = function(){
if (this.validator.validate()) {
$('#productcontactForm').submit(function(){
$('input[type=submit]', this).attr('enabled', 'enabled');
});
} else {
$('#productcontactForm').submit(function(){
$('input[type=submit]', this).attr('disabled', 'disabled');
});
}
}.bind(contactForm);
任何人有任何建議嗎? – Corey 2014-08-29 14:33:24