Replies
Hello,
The met slows down the rendering does not occur when a valid form by clicking the 'OK' button but if:
1) You enter a value in the 'txtStartField',
2) the field 'txtEndField is completed automatically,
3) You submit the form using the 'Enter' key in the 'txtStartField'
Result = field 'txtEndField' returns nothing!?
CAUTION:
Do not click on 'OK' but validate the form using the Enter key in the 'txtStartField'! Obviously using the 'OK' button the form returns the value contained much in the 'txtEndField', BUT, if you submit the form by giving the focus to 'txtStartField' cause then you re-mailing via the input of key 'Enter' txtEndField the field contains nothing!!
Do you understand me?
cordially
Oups….
Why no value is returned when the field txtEndField is filled ?
…
<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