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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to enable/disable a CurrencyTextBox in client side script ?

Thread ID:

Created:

Updated:

Platform:

Replies:

70881 Jan 7,2008 01:26 PM UTC Jan 11,2008 03:12 PM UTC ASP.NET Web Forms (Classic) 6
loading
Tags: Tools
Faleh
Asked On January 7, 2008 01:26 PM UTC

How to enable/disable a CurrencyTextBox in client side script ?

thanks for your support !


Vinoth Kumar K [Syncfusion]
Replied On January 7, 2008 07:49 PM UTC

Hi Faleh,

Thanks for using Syncfusion products.

You can enable/disable a CurrencyTextBox in client side script by using the below given snippet

//Java Script
function DisableCurrencyControl( )
{
var elem = document.getElementById('CurrencyTextBox1');
if (elem != null)
{
// toggle the disabled status
elem.disabled = !elem.disabled;
}
}

Please refer the sample in the below link which illustrates the above

http://websamples.syncfusion.com/samples/Tools.Web/6.1.0.34/F70881/main.htm


Please let me know if you have any questions.

Regards,
Vinoth



Faleh
Replied On January 8, 2008 11:27 AM UTC

Sorry But that doesn't work well.

In your example the CurrencyTextBox looks disable but we can change the text inside.




Vinoth Kumar K [Syncfusion]
Replied On January 8, 2008 05:54 PM UTC

Hi Faleh,

Thanks for using Syncfusion products.

Please refer to the updated sample.

Sample link:

http://websamples.syncfusion.com/samples/Tools.Web/6.1.0.34/FF70881/main.htm


Let me know if you have any questions.

Regards,
Vinoth



Faleh
Replied On January 10, 2008 08:01 AM UTC

The currency textbox is not totaly disabled
the (increment and decrement) are not disabled
so if we click on it, that causes a javascript error.

how to avoid this error ?


Vinoth Kumar K [Syncfusion]
Replied On January 10, 2008 10:09 PM UTC

Hi Faleh,

Thanks for using Syncfusion products.

Please refer to the updated sample that shows you "How to enable/disable the CurrencyTextBox Control using ClientScript?".

Sample link:
http://websamples.syncfusion.com/samples/Tools.Web/6.1.0.34/FFF70881/main.htm


Let me know if you have any questions.

Regards,
Vinoth



Suresh Sekarean [Syncfusion]
Replied On January 11, 2008 03:12 PM UTC

Hi Faleh,

If the CurrencyTextBox is disabled from the server side, all its child controls are disabled and also Client events like mouseup,mousedown are not registered to the DOM. But if we disable the control in Client side, it's Client events are still attached with DOM and causes the error.

Also these events would not be fired if Client Object of the control is null. So these event can be prevent to trigger if the Client Object of the control is removed from the window object. Please refer the below code to create/remove the Client Object of the control.

[Javascript]

//Remove Control Client Object from the window object
window["Numeric"]=null;

//Create new Client Object model to the control
window["Numeric"] = new SF_NumericTextBox("NumericTextBox1");

Please refer the below sample which illustrates the above.

http://websamples.syncfusion.com/samples/Tools.Web/6.1.0.34/F70881_1/main.htm

Thanks for using Syncfusion products.

Regards,
Sureshsekaran.


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.

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

;