Is it possible to set the return value if the user puts in a value above or below the set min/max? I don't want the box to reset to the defaulted value if the user enters above or below the min/max set values. In verson 10.3
Hello conrad1209,
It seems that the “Value” and “Text” properties of WebCurrencyEditor are linked, thus modifying the one property would change the other, too. So in this case I would suggest a possible workaround – when getting the value from the editor, just check if it is greater or less than certain limits and change it accordingly.
Please let me know if you have further questions.
Thank you for the reply. Would this be done in the code behind or javascript? Do you have an example? Thanks so much!
I think I am close, but it still doesn't set the value
<ig:WebCurrencyEditor ID="WebCurrencyEditor2" runat="server" Width="90px" OnTextChanged="CSPMAY_MyRecPrice" AutoPostBackFlags-ValueChanged="Async" BackColor="#ffff66" OnInvalidValue ="WebCurrencyEditor2_InvalidValue">
'code behind
Sub WebCurrencyEditor2_InvalidValue(ByVal sender As Object, ByVal e As Infragistics.Web.UI.EditorControls.InvalidNumberEventArgs)Dim txt As WebCurrencyEditor = DirectCast(sender, WebCurrencyEditor)If e.Text < txt.MinValue Then txt.Value = vbNullEnd IfEnd Sub
It seems that I misunderstood your question. In case that you have set the MinValue and MaxValue properties and you want to clear the control's content if a value out of this range is entered, I suggest that you do this in the client side InvalidValueEntered event handler:
function InvalidValueEnteredHandler(sender, eventArgs) {
//Set some timeout before clearing the value to avoid resetting it to min or max value
window.setTimeout("$find(\"WebCurrencyEditor1\").set_value(null);", 100);
}
Please let me know if this helps.
Hi conrad1209,
I'm just checking if you have any further questions.
Hello, your last reply only talked about setting a timer, not acutally answering the question. so this is still an open issue.
Nevermind, consider it answered.
Side note, the "more" button next to verify answer just hangs and doesn't do anything.