은 지금이 자바 스크립트 methid을 추가 한 :
유효성 검사를 서버에서 클라이언트로 실패했지만 라디오 버튼을 수동으로 변경 될 때까지 자바 스크립트가 runned하지 않습니다에 라디오 버튼이 correcly 설정
$(document).ready(function() {
$("#ModelViewAd\\.TypeOfAd :radio").change(function() {
if (this.id.match('TypeOfAd_Sell$') != null) {
$("#ModelViewAd_BuyNowPrice").removeAttr('disabled');
$("#divBuyNowPrice").fadeIn(500, null);
$("#divReservationPrice").fadeOut(500, null);
$("#ModelViewAd_ReservationPrice").attr('disabled', 'disabled');
$("#divEndDate").fadeOut(500, null);
$("#ModelViewAd_EndDate").attr('disabled', 'disabled');
$("#divStartingPrice").fadeOut(500, null);
$("#ModelViewAd_StartingPrice").attr('disabled', 'disabled');
}
else if (this.id.match('TypeOfAd_Buy$')) {
$("#divReservationPrice").fadeOut(500, null);
$("#ModelViewAd_ReservationPrice").attr('disabled', 'disabled');
$("#divEndDate").fadeOut(500, null);
$("#ModelViewAd_EndDate").attr('disabled', 'disabled');
$("#divStartingPrice").fadeOut(500, null);
$("#ModelViewAd_StartingPrice").attr('disabled', 'disabled');
$("#divBuyNowPrice").fadeOut(500, null);
$("#ModelViewAd_BuyNowPrice").attr('disabled', 'disabled');
}
else if (this.id.match('TypeOfAd_Let$')) {
$("#ModelViewAd_BuyNowPrice").removeAttr('disabled');
$("#divBuyNowPrice").fadeIn(500, null);
$("#divReservationPrice").fadeOut(500, null);
$("#ModelViewAd_ReservationPrice").attr('disabled', 'disabled');
$("#divEndDate").fadeOut(500, null);
$("#ModelViewAd_EndDate").attr('disabled', 'disabled');
$("#divStartingPrice").fadeOut(500, null);
$("#ModelViewAd_StartingPrice").attr('disabled', 'disabled');
}
else if (this.id.match('TypeOfAd_WishRent$')) {
$("#divBuyNowPrice").fadeOut(500, null);
$("#ModelViewAd_BuyNowPrice").attr('disabled', 'disabled');
$("#divReservationPrice").fadeOut(500, null);
$("#ModelViewAd_ReservationPrice").attr('disabled', 'disabled');
$("#divEndDate").fadeOut(500, null);
$("#ModelViewAd_EndDate").attr('disabled', 'disabled');
$("#divStartingPrice").fadeOut(500, null);
$("#ModelViewAd_StartingPrice").attr('disabled', 'disabled');
}
else if (this.id.match('TypeOfAd_Swap$')) {
$("#divBuyNowPrice").fadeOut(500, null);
$("#ModelViewAd_BuyNowPrice").attr('disabled', 'disabled');
$("#divReservationPrice").fadeOut(500, null);
$("#ModelViewAd_ReservationPrice").attr('disabled', 'disabled');
$("#divEndDate").fadeOut(500, null);
$("#ModelViewAd_EndDate").attr('disabled', 'disabled');
$("#divStartingPrice").fadeOut(500, null);
$("#ModelViewAd_StartingPrice").attr('disabled', 'disabled');
}
else if (this.id.match('TypeOfAd_Auktion$')) {
$("#ModelViewAd_BuyNowPrice").removeAttr('disabled');
$("#divBuyNowPrice").fadeIn(500, null);
$("#ModelViewAd_ReservationPrice").removeAttr('disabled');
$("#divReservationPrice").fadeIn(500, null);
$("#ModelViewAd_EndDate").removeAttr('disabled');
$("#divEndDate").fadeIn(500, null);
$("#ModelViewAd_StartingPrice").removeAttr('disabled');
$("#divStartingPrice").fadeIn(500, null);
}
})
});
?
현재 변경 핸들러에있는 모든 항목을 새 기능으로 이동하십시오. '$ ("# ModelViewAd \\. TypeOfAd : radio"). (function() {{}})', 그런 다음 해당 함수를 변경 핸들러에서 호출하고 jQuery 준비 함수 내에서 호출하십시오. – Ryan