This is a migrated thread and some comments may be shown as answers.

[Solved] Making NumericBox a Required Field

1 Answer 44 Views
NumericBox for HTML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bart
Top achievements
Rank 1
Bart asked on 18 Sep 2014, 11:53 AM
Is there a way to make the numericbox a required field within a form?  Even if an initial value is provided, the user can always clear the value.  Preferably, the required field should work similar to other textbox controls so that it can prevent form submissions and mark the control as invalid, display validation error messages, etc.

1 Answer, 1 is accepted

Sort by
0
Martin Yankov
Telerik team
answered on 23 Sep 2014, 09:18 AM
Hello Bart,

Thank you for contacting us.

The NumericBox control does not expose a property to set the required attribute automatically on initialization. However, you can still set the attribute once the control is initialized with jQuery:
$("#numeric-box .k-input").prop("required", true);

I have also attached a working example project for reference. Let me know should you have any other questions.

Regards,
Martin Yankov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
NumericBox for HTML
Asked by
Bart
Top achievements
Rank 1
Answers by
Martin Yankov
Telerik team
Share this question
or