How to add a field validator and set it programmatically
<p>I need to add a field validator, the admin of the website sets the number of characters of a textbox in admin and then... in the front side users can only type upto the number of characters specified by the admin.</p>

<p>In the fron end i aleady pull the number from the database but now i am not sure how to create a validator where i can set the value say:</p>

<pre><code>pseudocode

Get the validator
 set the validator to validate these maximum number of characters
     myValidator.setamaxnumber = mydbvalue;
     error message = Only + mydbvalue + charaters are accepted.
</code></pre>

<p>I hope you understand what i want to do. If not, no need to do a negative vote post your question and i will try my best to supply more information</p>

<p>Thanks a million</p>
