單擊按鈕時; 如果所有文本框不是空的在它將指向下一頁的頁面上。我做了控制它的工作。但我怎樣才能定位到另一個頁面與jQuery?頁面方向與JQuery的?
$(document).on("pageinit", "#registerPage1", function() {
$(".nextBtn").click(function() {
if ($(".txt").val().lenght != 0) {
// i want to write codes for orientation registerPage1 to registerPage2 in here
}
$(".txt").each(function() {
if ($(this).val().length == 0 && $(this).next().attr('class') != 'nullInputMsg') {
($(this)).after('<div class="nullInputMsg">this field is required!</div>');
}
else if ($(this).val().length != 0 && $(this).next().attr('class') == 'nullInputMsg')
$(this).next().remove();
});
});
});
是的,我做了類似的想法: $ x =「true」; $(「。requiredText」)。each(function(i){if(this).val()。length) $ x =「false」; } ); if($ x ==「true」) // commands }); });; }); – ebruszl