フォームにリピーターがあり、jqueryを使用してリピーターのデータを検証しました。jqueryを使用してクライアント側でページがリダイレクトされないようにするのに問題があります。
これが私のjqueryです:
function ValidateBid()
{
$(document).ready(function () {
$(".btnSubmitBid").click(function (evt) {
var msg = "";
var bid = $(this).closest('td').find("input"); //this was the fun part
if (isNaN(bid.val())) {
msg = "Bid amount allowed in complete dollars only";
}
if (bid.val().indexOf('.') >= 0) {
msg = "Bid amount may only contain numbers";
}
if (bid.val() > 999999) {
msg = "If you want to place a bid for $" + bid.val() + " please contact customer service";
}
if (msg.length > 0) {
$('#dialogText').text(msg);
$('#dialog').dialog({
closeOnEscape: true, modal: true, width: 450, height: 200, title: 'Please correct the errors below:', close: function (event, ui) { $(this).dialog("destroy"); }
});
evt.preventDefault();
return false;
}
else {
return true;
}
});
});
} //ends doc rdy
return falseとevt.preventDefault();を使用してみました。運がない。
ユーザーがまだログインしていない場合は、repeater_ItemCommandイベントのコードビハインドでリダイレクトされます。
どんな助けでも大歓迎です。ありがとう。