Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Datagrid Control (http://www.velocityreviews.com/forums/f60-asp-net-datagrid-control.html)
-   -   Execute Client Side Script from TextBox in Template column (http://www.velocityreviews.com/forums/t759923-execute-client-side-script-from-textbox-in-template-column.html)

David C. Churchill 11-20-2003 02:03 AM

Execute Client Side Script from TextBox in Template column
 
I have a datagrid with 3 template columns, each containing a textbox.
I want to handle one of the textbox's OnTextChanged Event and have some
client side JavaScript execute. The client side code will update one of the
textbox's values by subtracting the values in the other 2.

I'm able to add the JavaScript using RegisterClientScript and added the
script function to the textbox control using Attribute.Add in the DataGrid's
ItemDataBound event.

When I load the page I get nothing, clicking view source shows the
JavaScript code and each controls OnTextChanged event handler.

Any ideas what I'm doing wrong? Is this even possible? I really don't want
to do this server side as the postbacks with a datagrid holding over 100
rows can be pretty annoying.

Any help would be greatly appreciated.

Thanks,



David C. Churchill 11-20-2003 04:09 AM

Re: Execute Client Side Script from TextBox in Template column
 
Nevermind,
I fixed it:
I was using:
Attribute.Add("OnTextChanged", "myScript()")
But I should have been using: Attribute.Add("OnChange", "myScript()")

^^^^^^^^^^^^^
I guess it helps to actually know JavaScript and the DHTML objects before
you try to use them :)

Thanks anyway,

"David C. Churchill" <dchurch@covad.net> wrote in message
news:u9GzFqwrDHA.1060@TK2MSFTNGP12.phx.gbl...
> I have a datagrid with 3 template columns, each containing a textbox.
> I want to handle one of the textbox's OnTextChanged Event and have some
> client side JavaScript execute. The client side code will update one of

the
> textbox's values by subtracting the values in the other 2.
>
> I'm able to add the JavaScript using RegisterClientScript and added the
> script function to the textbox control using Attribute.Add in the

DataGrid's
> ItemDataBound event.
>
> When I load the page I get nothing, clicking view source shows the
> JavaScript code and each controls OnTextChanged event handler.
>
> Any ideas what I'm doing wrong? Is this even possible? I really don't

want
> to do this server side as the postbacks with a datagrid holding over 100
> rows can be pretty annoying.
>
> Any help would be greatly appreciated.
>
> Thanks,
>
>





All times are GMT. The time now is 07:28 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57