Hi ! m Pawan .
m trying to use javascript validation code for an asp.net tool
i had tried for textbox.but its not working properly.
can some body help me.
Hi ! m Pawan .
m trying to use javascript validation code for an asp.net tool
i had tried for textbox.but its not working properly.
can some body help me.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Apr 18, 2009, 8:51 AM
take 2 TextBox "TextBox1 and TextBox2
then Set CustomValidator Control's ControlToValidate Propertie to "TextBox2"
and ClientValidationFunction="CheckText"
Validator checks Text Box for "Hello" Text if Not found text = "Hello" Will Display Error
if you Want to Validate that if TextBox is Blank then Also Make ValidateEmptyText propertie of CustomValidator to true
Check it out :)
/**********************************************************
To make Calender Popup
/**********************************************************
Place Calendar Control on form
in Page_Load Event Write
Calendar1.Visible = false ;
and Write
Calendar1.Visible = true ; in Button_Click Event
Thats it :)
Happy Coding :)
Niradhip ChakrabortyPosted Apr 18, 2009, 8:34 AM
function validation()
{
//1.Checking whether value is there in textbox or not.
if(document.getElementById("txtanswer").value=="")
{
alert("Please Enter The Answer");
document.getElementById("txtanswer").focus();
return false;
}
//2.Checking textbox for email format
if (!isEmail(document.getElementById("txtEmail3").value))
{
alert("Please Enter a Valid E-Mail Address in Shipping Address");
document.getElementById("txtEmail3").focus();
return false;
}
}
function isEmail(s){
if (s.search(/^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/) == -1){
return false;
}
else{
return true;
}
}
Pawan BhisePosted Apr 18, 2009, 5:25 AM
and also wan to pop up an calender control in abutton click.
Pawan BhisePosted Apr 18, 2009, 5:25 AM
and also wan to pop up an calender control in abutton click.
Pawan BhisePosted Apr 18, 2009, 5:25 AM
and also wan to pop up an calender control in abutton click.
Pawan BhisePosted Apr 18, 2009, 5:25 AM
and also wan to pop up an calender control in abutton click.
Niradhip ChakrabortyPosted Apr 18, 2009, 4:10 AM
Hi Pawan,
Please wxplain your requirement in details.
Vijaya KadiyalaPosted Apr 17, 2009, 1:45 PM
Hi
Check out the below article.
http://www.c-sharpcorner.com/UploadFile/purankaushal/103222006013805AM/1.aspx?ArticleID=10c0cce3-e00f-4dad-9ddb-df0c669afd6c
Thanks -- Vijaya Kadiyala
www.DotNetVJ.com
Mohan Kumar RajasekaranPosted Apr 17, 2009, 5:07 AM