Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am trying to put validation on a textbox it is associated with a checkbox when user checked checkbox then validation should work otherwise not. And this is also related to a validationgroup in asp.net. If I click on the button then it must be checked and one more thing is that i can't put my js code in .aspx file it must be in separate .js file so please tell how can put wright one validation not to waste time in experimenting and it must be at client side.

Thanks!
Posted

Hi sat_dev ,

you can use JavaScript for your Validation in a separate file itself , Write a JavaScript in a file and store it as like 'FileName.js' and then include the Javascript file in the header of your .aspx file as mentioned below ,


 
Share this answer
 
Comments
Satyendra Kumar(Analyst Programmer) 15-Oct-11 4:00am    
dear this is not expected answer i have good exp. in web development but in validation with javascript and for associated checkbox i didn't do this in my carrier so that i asked. So please give me the way how can i manage validation on the client side.
Hi,

just try this
JavaScript
   function f1()
{
    if(document.getElementbyID("rdb").checked)
{
     //call validation method which is placed in another js file
}
else
{

}
}


All the Best
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900