I have a webdatagrid two template fields... textboxes.. when the user enters a value in the first one and then goes to the second one, I need to make sure the second value is not greater then the first value...
Can someone help with some client side script to do this?
so I am saying your sample does not work.
I am using version 12.2 and you are using 13.1 could that be the difference?
Sorry, no dice
When I enter a value in the first template column then enter a value in the second template column and tab out I get the following error
Microsoft JScript runtime error: Unable to get value of the property 'get_row': object is null or undefined
If I just tab through the second template field the textboxTextchanged event does not fire because no text has changed.
Hello Daryl,
I have created a new sample including Master Page. I have tested it with Firefox, Chrome, IE10, IE9, IE8, IE7 and seems to work fine.
Could you test the sample and see if it works on your configuration. What is the browser that you are using? Could you test the sample with different browsers? I suggest that you start from a working sample and build on, so it is clear where it crashes.
If you have any questions or concerns with this, please let me know and I'll be glad to help.
Also, I have all the requisite files and such already... ig_res, etc.. and the code behind works fine.
using your updates sample i still get the following error..
<script type="text/javascript" id="igClientScript"> function textboxTextChanged(sender, eventArgs) { if (parseInt(sender.parentNode._object.get_row().get_cellByColumnKey("TemplateField_0").get_element().getElementsByTagName("input")[0].value) < parseInt(sender.value)) { sender.value = ""; } }
Could this be an issue because I have a master child page setup?
<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="350px" Width="737px"> <Columns> <ig:TemplateDataField Key="TemplateField_0"> <ItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Width="50px"></asp:TextBox> </ItemTemplate> <Header Text="FirstTextBoxTemplateField"></Header> </ig:TemplateDataField> <ig:TemplateDataField Key="TemplateField_1"> <ItemTemplate> <asp:TextBox ID="TextBox2" runat="server" onchange="textboxTextChanged(this, event)"> </asp:TextBox> </ItemTemplate> <Header Text="SeccondTextBoxTemplateField"></Header> </ig:TemplateDataField> </Columns> <Behaviors> <ig:Selection> </ig:Selection> </Behaviors> </ig:WebDataGrid>