iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
I have two questions,
1、How can I Limit text box can only enter a integer?
2、Then can I set the range of integer?
For example, if I set the maximum to 1000, when I enter 1001, the value is set to 1000.
Thanks!
Hello,
You can use only Integer by using NumericInput properties. Currently, we don't have maximum or minimum for the number. You can only set EditMask for total digit. However, you can validate the number max or min with below code.
function WebInput1_OnDirty(controlId, dirtySourceType) { var WebInput1 = ISGetObject(controlId); if (WebInput1.GetValueData(true) > 1000) { WebInput1.SetValueData("1000", true); } return true; }
Regards,Handy
Hello,You can use only Integer by using NumericInput properties. Currently, we don't have maximum or minimum for the number. You can only set EditMask for total digit. However, you can validate the number max or min with below code. function WebInput1_OnDirty(controlId, dirtySourceType) { var WebInput1 = ISGetObject(controlId); if (WebInput1.GetValueData(true) > 1000) { WebInput1.SetValueData("1000", true); } return true; }Regards,Handy
Can you give me a example or some codes?
Hi Handy,
The following code can achieve the feature.But,there still have two issues,
1、When I input “1111”,then input "." (point), the value will be changed to "0".
2、If I entered the value, I can not clear the text box, text box value is always 0.
<ISWebInput:WebInput ID="WebIntInput2" runat="server" NumericInput="true"> <EditFormat Format="0" IsEnabled="true" Type="DynamicNumber"> </EditFormat> </ISWebInput:WebInput>
Can you tell me how to solve these issues?
Thanks a lot!
Gavin
Hello Gavin,
That because you set EditFormat as 0. When you have texted any number, WebInput marked it as dirty. Every time you clear the value, it will also revert back to 0. About issue "." (point), I need to discuss this to our developer teams.
Hello Handy,
Can you tell me the right EditFormat string to archive the feature?
Thanks,
Ok, but could you explain more details about your scenario?
Example, what do you expect when user clear the data? And shouldn't the validation for limit number work fine?
1, I can limit the value type of text box to input . Such as (integer, numeric).2, if integer, you can only input "0-9"and" -. "3, if numeric, you can only input "0-9","-" and".".4, the text box can input empty string.5, when I input the illegal character,the text box value does not change to 0 .
Can you tell me the tow right EditFormat strings(Integer and numeric)?
Gavin.
I think it is not possible to have "-". As far I know, "-" is not a integer or numeric but it is recognized as string. This character is used for separator.Also "," character could not be used dynamically. You need to know what is the correct format.example
100,00.00 which is incorrect format. Most likely should be 1,000,00.00
The format should be defined with Mask input.
"-" is mean the integer less than 0.
To use "-" for negative or positive sign, you need to use DynamicInput. Please see my attached sample.
, I added the following JS code at aspx page, but there will be such a issue. When I enter 1, the text box value changes to 100, when I want to change 100 to 200, I can not do it. Because when I enter the Backspace, the value of the text box will change to 100.
Can you tell me how to solve it?
function WebInput1_OnDirty(controlId, dirtySourceType) { var WebInput1 = ISGetObject(controlId); if (WebInput1.GetData() > 1000) { WebInput1.SetValue("1000"); } if (WebInput1.GetData() < 100) { WebInput1.SetValue("100"); } return true; }
Hello Handy,, I added the following JS code at aspx page, but there will be such a issue. When I enter 1, the text box value changes to 100, when I want to change 100 to 200, I can not do it. Because when I enter the Backspace, the value of the text box will change to 100. Can you tell me how to solve it?Thanks!function WebInput1_OnDirty(controlId, dirtySourceType) { var WebInput1 = ISGetObject(controlId); if (WebInput1.GetData() > 1000) { WebInput1.SetValue("1000"); } if (WebInput1.GetData() < 100) { WebInput1.SetValue("100"); } return true; }
Use OnBlur event and WebInput1.SetValueData method can solve it!
I am glad to hear that you find a solution for your scenario. Thank you for the confirmation.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname