Edit 02/05/2011
Ok, so i need to make my validation clientside, so I need what asked for below in c# to actually be in jquery. I will also be validating server side so I would appreciate more input there.
Original Question
Well, im on a real noob question trip today!!!
My previous question was for a specific regex. Now I have it and it works..how can I roll it out over multiple text boxes? I don't want to use multiple Regular Expression Validation tools as they would clutter up my design space and I don't think it's a very elegant solution (It's for a degree project)
Is there a method I could write? Along the lines of
public validator(string)
{
doessomething.tostring
return true/false
}
and access by
if (validator(txtsomething.text.tostring()) = true)
{
Dothis
}
else
{
dothis
}
Please be patient if my question is garbage :) Thanks``
RegularExpressionValidator, then the code examples below would all need to be done in JavaScript for the client side or run at the server.