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

I need your valuable suggestions/Advice for my Query.

My Query:

* I am having a User control (As like Grid View with Some TextBoxes)
* I used the above mentioned User control in a page
* Page is having the user control plus a Button.

Once I click on the Button, The Value in the TextBox (From User control) need to be validated.
I need to do the above at the client Side with the help of Javascript.

Please help me to write the validation.

Thanks in Advance :)
Posted

1 solution

Hi,

call a Javascript function on the button click in the usercontrol.ascx page.
it can be smthng like below:

JavaScript
function validate(text)
{
var x=text.indexOf(';');
if(x!=-1)
{
alert('the text doesnt contain semicolon');
}
else
{
alert('the text contains semicolon');
}

}


you can have a validation as u wud like..i just gave an example..

hope it helps.

cheers
 
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