I'm new in asp.net. i wrote script for checking the value of asp.net drop down list(below code):
<script>
$(document).ready(function () {
debugger;
$('#<%=offermessage.ClientID%>').on('change', function () {
var a = $(this).val();
if (a == 9) {
$('#dealer_name').fadeIn();
$('#vin_number').fadeOut();
}
if (a == 10) {
$('#dealer_name').fadeIn();
$('#vin_number').fadeIn();
}
if (a == 11) {
$('#vin_number').fadeIn();
$('#dealer_name').fadeOut();
}
if (a == 12) {
$('#dealer_name').fadeOut();
$('#vin_number').fadeOut();
}
if (a == 13) {
alert("لطفا موضوع پیشنهاد و شکایت را انتخاب نمایید.")
}
});
});
</script>
now i need to write an script that checked the value when i want to submit the form.below script written and function return in submit button .
<script>
function subjectvalidate(offermessage) {
$('#<%=offermessage.ClientID%>').on('select', function () {
var a = $(this).val();
if (a == 13) {
alert("لطفا موضوع پیشنهاد و شکایت را انتخاب نمایید.")
return false;
}
}
)};
</script>
but it's not work .any body can help me ??? thanks