单击按钮时; 如果所有文本框不是空的在它将指向下一页的页面上。我做了控制它的工作。但我怎样才能定位到另一个页面与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