2
我正在處理不會在IE中提交的提交表單。我沒有寫代碼,想知道是否有一些顯而易見的事情發生在IE瀏覽器不喜歡的地方。表格不在IE中提交
$(function(){
{% if show_existing_form == False %}
$('#publisher-signup').toggle();
$('#existing-user-pub-signup').toggle();
{% endif %}
$('#new-user').click(function() {
$('#publisher-signup').toggle();
$('#existing-user-pub-signup').toggle();
});
$('#existing-user').click(function() {
$('#publisher-signup').toggle();
$('#existing-user-pub-signup').toggle();
});
var disable_submit = function() {
if ($('#publisher-submit').attr('disabled') !== 'disabled') {
$('#publisher-submit').attr('disabled', 'disabled');
}
};
var enable_submit = function() {
if ($('#publisher-submit').attr('disabled') === 'disabled') {
$('#publisher-submit').removeAttr('disabled');
}
};
var check_passwords_match = function() {
if ($('#password').val().trim() === '' || $('#confirm-password').val().trim() === '') {
disable_submit();
} else if ($('#password').val() !== $('#confirm-password').val()) {
$('#password-mismatch').show();
disable_submit();
} else {
$('#password-mismatch').hide();
enable_submit();
}
};
$('#confirm-password').change(check_passwords_match);
$('#password').change(check_passwords_match);
$('#email').change(function() {
$.ajax({
'url': '/preview',
'type': 'POST',
'data': {
'check-username': true,
'email': $('#email').val()
},
'success': function(data, textStatus, jqXHR) {
if (data.exists === true) {
$('#user-exists').removeClass('hide');
} else {
$('#user-exists').addClass('hide');
}
}
});
});
$('#existing-submit-btn').click(function(){
$('#publisher-existing-signup').submit();
});
$('#publisher-submit-btn').click(function(){
$('#publisher-purchase').submit();
});
});
所有瀏覽器都有一些奇怪的表單提交怪癖。檢查你的表單是否有'input type =「submit」',如果沒有,則添加一個。如果解決了這個問題,你就有了一個開始的地方。 – Milimetric 2012-01-05 15:42:02
控制檯中是否有JavaScript錯誤? – JJJ 2012-01-05 15:42:39
也許值得發佈html? – matpol 2012-01-05 15:44:52