OnSelectedIndexChanged...

123456qwerty

New Member
I am using the asp drop down list and trying to submit a form<BR><BR><asp:dropdownlist CssClass="lstbx" ID="title_id" DataValueField="title_id" DataTextField="title_name" OnSelectedIndexChanged="GetVehicleRate" AutoPostBack="true" runat="server" /><BR><BR>I have another field where input has to be put first before the dropdown submits. I have added the aspvalidator control for that txt field.<BR><BR>But the sad part it, when I am submitting the dropdown without any value in the text field it just submits without giving an error that field is empty...<BR><BR>While using the same code if I have a submit button... it gives me an error that field is empty.<BR><BR>What could be the problem and how to solve it<BR><BR>ThancThe thing is that the onselectedindexchanged event will fire a sub that you define using using the autopostback. Therefore it will not validate your other text field using an asp validator. The simplest solution is to write code in your defined sub that checks that text field for a value. Or else remove your onselectedindexchanged & autopostback event.<BR><BR>
 
Back
Top