Hi all,
I have a grid, and I have designed edit template "input type=text" and in onkeypress text box I want to do these 2 actions:
1- validate input value to be number (I have done).
2- put this value in the next row text box (how to do?).
so anyway in javascript to control next edit row cells?
My code below:
Please advise
Regards
I have a grid, and I have designed edit template "input type=text" and in onkeypress text box I want to do these 2 actions:
1- validate input value to be number (I have done).
2- put this value in the next row text box (how to do?).
so anyway in javascript to control next edit row cells?
My code below:
<telerik:GridTemplateColumn ColumnEditorID="GridTextBoxColumnEditor1" |
DataField="start" HeaderText="start" SortExpression="start" UniqueName="start"> |
<EditItemTemplate> |
<input id="Text1" style="width: 40px" type="text" onkeypress="return Bind(event)"/> |
</EditItemTemplate> |
<ItemTemplate> |
<asp:Label ID="startLabel" runat="server" Text='<%# Eval("start") %>'></asp:Label> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
. |
. |
. |
. |
function Bind(e) |
{ |
var keynum; |
var keychar; |
var numcheck; |
if(window.event) // IE |
{ |
keynum = e.keyCode; |
} |
else if(e.which) // Netscape/Firefox/Opera |
{ |
keynum = e.which; |
} |
keychar = String.fromCharCode(keynum); |
numcheck = /\d/; |
return numcheck.test(keychar); |
} |
Please advise
Regards