Hello,
Thank you for your response. After that I encounter another problem. Indeed, I enter a value in the field txtStartField, it is automatically copied into the field txtEndField and when I post the form to validate the use of the Enter key in the field txtStartField, the value field txtEndField returned the server side is still empty! Why??
…
<script language=javascript>
//Copies the value in the field in the field txtStartField txtEndField
function copyValue() {
var ctrlSrc = window.$get('<%=txtStartField.ClientID%>');
var ctrlDst = window.$get('<%=txtEndField.ClientID%>');
ctrlDst.value = ctrlSrc.value;
}
//Required if the field does not format properly txtEndField value copied !
function activeEndField() {
var ctrlDst = window.$get('<%=txtEndField.ClientID%>');
ctrlDst.focus();
ctrlDst.blur();
}
//Post the form after the Enter key was used in one of two fields WebNumericEditor
function postForm(){
var button = ig_getWebControlById("<%=wibSearch.ClientID %>");
if (event.keyCode == 13)
if (button != null)
button.click();
}
</script>
…
…
<ig:WebNumericEditor NullText="" ClientEvents-Blur="activeEndField" ClientEvents-TextChanged="copyValue"
DataMode="Decimal" ID="txtStartField" runat="server" Width="100px" MaxLength="16" MinDecimalPlaces="0" MaxDecimalPlaces="2" onkeyDown="BLOCKED SCRIPTpostForm();">
</ig:WebNumericEditor>
<ig:WebNumericEditor NullText="" ID="txtEndField" runat="server" Width="100px" DataMode="Decimal" MaxLength="16" MinDecimalPlaces="0" MaxDecimalPlaces="2" >
</ig:WebNumericEditor>
<br>
<igtxt:WebImageButton ID="wibSearch" runat="server" Text="OK" SkinID="BoutonRechercher" OnClick="wibSearch_Click" Width="100px">
</igtxt:WebImageButton>
….
c# :
protected void wibSearch_Click(object sender, Infragistics.WebUI.WebDataInput.ButtonEventArgs e)
{
string a1 = txtStartField.Text;// is ok !
decimal a2 = Convert.ToDecimal(txtStartField.Value); //is ok
string a2 = txtEndField.Text; //is null or empty ????
decimal b2 = Convert.ToDecimal(txtEndField.Value); //is null ????
}
Why no value is returned when the field txtStartField is filled ?
cordially