Hi All,
I am using java script for validating the textbox in my asp.net page. Validation is working fine but when i click the submit button the empty values are inserting in my database. Please help me how shall i overcome this problem.
this is for validation
I am using java script for validating the textbox in my asp.net page. Validation is working fine but when i click the submit button the empty values are inserting in my database. Please help me how shall i overcome this problem.
Code:
function check(id,l)
{
var st;
st=document.getElementById(id).value;
if(st=="")
document.getElementById(l).innerHTML="Enter User Name..";
}
Code:
Button1.Attributes.Add("onclick", "validate('" + TextBox1.ClientID + "','" + TextBox2.ClientID + "','" + DropDownList2.ClientID + "','" + Label4.ClientID + "')")
Code:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim obj As New creatinguser
Label5.Text = obj.create(TextBox1, TextBox2, DropDownList2)
End Sub
Comment