i am doing validation thru javascript
for this i have written a function in(form1.aspx) javascript like this
function checkfield(myfo rm)
{
var myform=document .forms[0];
ok=true
if(myform.txtna me.text=="")
{
alert("Please Enter Your FirstName.")
myform.txtname. focus()
ok=false
break;
}
if(myform.txtad dress.text=="")
{
alert("Please Enter Your lastName.")
myform.txtaddre ss.focus()
ok=false
break;
}
and i am calling this from form(form1.aspx .cs) like this
Button1.Attribu tes.Add("onclic k", "return checkfield(form 1);");
so what is happening , without completing the field it is getiing inserted in database for this i have written code,pls help me.
waitning ur reply
shashikant
for this i have written a function in(form1.aspx) javascript like this
function checkfield(myfo rm)
{
var myform=document .forms[0];
ok=true
if(myform.txtna me.text=="")
{
alert("Please Enter Your FirstName.")
myform.txtname. focus()
ok=false
break;
}
if(myform.txtad dress.text=="")
{
alert("Please Enter Your lastName.")
myform.txtaddre ss.focus()
ok=false
break;
}
and i am calling this from form(form1.aspx .cs) like this
Button1.Attribu tes.Add("onclic k", "return checkfield(form 1);");
so what is happening , without completing the field it is getiing inserted in database for this i have written code,pls help me.
waitning ur reply
shashikant
Comment