新しい問題/回答
ie9 に入力のプレースホルダー テキストを値として設定させる HTML5 プレースホルダー ポリフィルを使用しています。そのため、HTML5 ブラウザーでは val 属性は空ですが、以下のコードでは ie9 はそれが入力されていると認識しています。
すべてのフィールドが入力されていることを確認するために jQuery を使用しています。
ここで何が間違っているのですか? なぜこのコードは ie9 で動作しないのですか?
ありがとうございました!
$('#quoteform .button.next').on('click',function(){
var $me = $(this),
$myParent = $me.parent(),
$nextStep = $myParent.nextAll('fieldset:not(.disabled)').first(),
validate;
// If we're on step2, make sure all fields are filled in
if($me.is('#quote-step2 .button') || $me.is('#quote-step1 .button')) {
$me.parents('fieldset').find('input:visible').each(function(){
var $me = $(this),
myVal = this.value;
if(myVal === '') {
$me.parent().addClass('warning');
validate = false;
return;
} else {
if(typeof validate === 'undefined')
validate = true;
}
});
}
if(validate === false) {
alert('Please fill out all fields before continuing.');
return false;
}
switchView($nextStep, $myParent);
});