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

changing maxvalue of numerictextbox dynamically or changing the maxvalue of numerictextbox from Javascript using razor.

Thread ID:

Created:

Updated:

Platform:

Replies:

107246 Feb 21,2013 09:34 AM UTC Feb 22,2013 11:14 AM UTC ASP.NET MVC (Classic) 2
loading
Tags: Tools
Devendar
Asked On February 21, 2013 09:34 AM UTC

Hi,
 
How can I change the maxvalue of numerictextbox's value from javascript, when we select something from dropdown list.
 
Thanks in advance
 

Devendar
Replied On February 21, 2013 05:04 PM UTC

Hi.
 
How we can set empty value to numerictextbox from javascript.
 
Thanks in advance.

Meena [Syncfusion]
Replied On February 22, 2013 11:14 AM UTC

Hi Devendar,

 

Thanks for contacting Syncfusion forums.

 

Query1: How can I change the maxvalue of numerictextbox's value from javascript, when we select something from dropdown list.

 

Your requirement of setting the max value to the NumericTextbox control based on any value in a dropdown can be achieved using  “obj._maxValue” method (where obj is the client object of numeric text box control). Please refer the below code snippet,

 

<code>

[View]

@Html.DropDownList("dropdown")

 

@Html.Syncfusion().NumericTextBox("num").Value(40)

 

[Script]

 

$(document).ready(function () {

        $("#dropdown").bind('change', function () {

            var obj = $find("num");

 

            var selectedVal = $("#dropdown").val();

            obj._maxValue = parseInt(selectedVal);

          

        });

    });

 

 

</code>

 

Query2: How we can set empty value to numerictextbox from javascript.

 

Currently we do not have support for setting null/empty values directly in Editors package. We have already logged a feature request report for this requirement in our database, we will implement this feature in our upcoming release Vol2, 2013, which will be rolled out by May, 2013. As for now, we have made a workaround solution for this requirement, please refer the below code snippet,

 

<code>

    function setval() {

        $(".sfInputText").val("");           //$("#num_numerictextbox") can also be used, where "num" is the control ID

    }

 

</code>

 

We have also prepared a simple sample with the above requirements and it can be downloaded from the below link.

 

Kindly have a look at the sample and let us know if it helps.

 

Please let us know if you have any other concerns.

 

Regards,

Meena



SyncfusionMVCApplication_8d9aba6.zip

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

or the page will be automatically redirected to 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

;