Javascript firing within a datagrid

G

Guest

I've got this great wee function which strips out the spaces entered into a
textbox and it does this on the key press off a user. I got this working in a
test application no problem however when I went to intergrate it with my real
application which has the textbox in the footer of a datagrid the javascript
doesn't seem to run. Has anyone any idea why this is not working for me?

Any help would be much appreciated. Thanks

Here is the function and the textbox which I'm using

<script language="javascript" type="text/javascript">

<script language="javascript" type="text/javascript">
function CheckValidAdd(textbox, val)
{
val = val.replace(/[^0-9a-zA-Z]/g, '');
textbox.value = val;
}

</script>
<FooterTemplate>
<asp:TextBox ID="add_NINo" onKeyUp="CheckValidAdd(add_NINo,
add_NINo.value);" Columns="5" Runat="Server" />
</FooterTemplate>
 
N

Nicholas Paldino [.NET/C# MVP]

Stephen,

Have you checked what is actually output to the client? What you have
shown is the ASP.NET code, which is different from what the client sees. I
think that if you show that, it would help provide insight into why it is
not working.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top