JavaScript with DropDownList
-
Hi... I am using a dropdown list with autopostback = true. I am performing validation using JavaScript with the fallowing function function ddlCheck() { var dt = document.getElementById("<%= ddlClassRoomNo.ClientID%>").value; if (parseInt(dt) != 0) { return true } else { alert('Select a value') return false } } i am calling this with setting attributes to the control on the page load event just like this ddlClassRoomNo.Attributes.Add("OnChange", "return ddlCheck();") it works fine but when the condition is true the AutoPostback is not happening how can i solve this. Thanks in Advance
-
Hi... I am using a dropdown list with autopostback = true. I am performing validation using JavaScript with the fallowing function function ddlCheck() { var dt = document.getElementById("<%= ddlClassRoomNo.ClientID%>").value; if (parseInt(dt) != 0) { return true } else { alert('Select a value') return false } } i am calling this with setting attributes to the control on the page load event just like this ddlClassRoomNo.Attributes.Add("OnChange", "return ddlCheck();") it works fine but when the condition is true the AutoPostback is not happening how can i solve this. Thanks in Advance
try this: if (parseInt(dt) != 0) { Form1.submit(); }
-
try this: if (parseInt(dt) != 0) { Form1.submit(); }
-
It does not work with drop downlist even though you retrun true postback will not occure -- modified at 8:34 Wednesday 26th September, 2007
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "