We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problems when creating NumericTextbox and validations

Thread ID:

Created:

Updated:

Platform:

Replies:

143247 Mar 11,2019 05:05 PM UTC Mar 13,2019 12:11 PM UTC ASP.NET Web Forms (Classic) 3
loading
Tags: NumericTextBox
Roger Alberto
Asked On March 11, 2019 05:19 PM UTC


1. The following code does not contain validations and appears without errors.




    2. But when you put the validators, it shows that you can not set the ValidationRule property in the Numerictextbox control.


   
        

3. Also when I use the requiredfieldvalidator asp, the controls lose format.

 
   
    
   
   
   
   

4. Finally. I have the scripts in my master page to be able to visualize the validations, this works with the GRID control but with the rest.





Christopher Issac Sunder K [Syncfusion]
Replied On March 12, 2019 11:01 AM UTC

Hi Roger, 

Thank you for contacting Syncfusion support. 

Please find the responses for your query below, 

Query – 1: “Not able to set validation in NumericTextBox” 

The NumericTextBox control contains hidden element which contains the value and this hidden element is not validated by default. You need to include the hidden elements in jQuery validation and set “[]” in “ignore” API of “$.validator.setDefaults” to enable validation in NumericTextBox. Please refer to the below code snippet, 

<script> 
$.validator.setDefaults({ 
    //to validate all fields(hidden also) 
    ignore: [], 
    //if we don’t set custom class, default “error” class will be added 
    errorClass: 'e-validation-error', 
    //it specifies the error message display position 
    errorPlacement: function (error, element) { 
        $(error).insertAfter(element.closest(".e-widget")); 
    } 
}); 
</script> 

Please find the details regarding this in the documentation link given below, 

Query – 2: “On using requiredfieldvalidator control loses format” 

We tried the validation using requiredfieldvalidator in NumericTextBox and it was working fine. We could not reproduce the issue from our side. Could you share us more details regarding this issue so that we can help you resolve it. 

We have prepared a sample based on the above queries for your reference. Please find it below, 

Sample: 

Let us know if you have any concerns. 

Thanks, 
Christo 


Roger Alberto
Replied On March 12, 2019 01:09 PM UTC

Really, really thanks for your response. Apply the first solution and it worked.

Christopher Issac Sunder K [Syncfusion]
Replied On March 13, 2019 12:11 PM UTC

Hi Roger, 

We are glad to hear that the provided solution worked for you. Please let us know if you require any further assistance. 

Thanks,
Christo 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;