<script type="text/javascript" language="javascript">
function pageLoad(sender, args) {
$('#bvft').addClass("bvft");
$('#new').live('click', function() {
$('#bvft').removeClass("bvft");
$('#bvft').show("slow");
});
$('.ddlFrTime').change(function() {
var vFTime = $('.ddlFrTime').val();
if (vFTime != "") {
$('#bvft').removeClass("bvft");
$('#bvft').show("slow");
}
else { alert("sorry"); }
});
}
</script>
In $('#bvft'), I have one dropdownlist
<asp:DropDownList ID="ddlFrTime" runat="server" Width="250px" CssClass="ddlFrTime" AutoPostBack="true"
OnSelectedIndexChanged="ddlFrTime_SelectedIndexChanged">
</asp:DropDownList>
$(#bvft) is div id. $('#new') is button id. When page load, I want to disable. It works perfect. When I click the button, $(#bvft) div will show. But the problem is (in div, I have dropdownlist) when I select dropdownlist, the postback will work. At this time div is automatically hide back. How to prevent for this. Actually I used function pageLoad() to prevent postback. But it's not working.
return falsework? I know it stops the href action of a link. Worth a try I guess