In the second piece of code there is a value of 250 which is the field length passed to the function as parameter maxlimit. Contextually this will change based on the type of information being entered. I get the corresponding length through a stored procedure that looks at the syscolumns table and I want to substitute this value for the physical 250 embedded in the code behind.
I get nothing.
function textCounter (field, countfield, maxlimit)
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);
countfield.value = maxlimit - field.value.length;
<TD><asp:textbox onkeydown="textCounter(txtName, this.form.countReferenceLength, 250);" id="txtName" onkeyup="textCounter(txtName,this.form.countReferenceLength, 250);" runat="server" Width="100%" CssClass="DefaultTextBoxStyle"></asp:textbox></TD>