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. Image for the cookie policy date
close icon

Sample for editors

Hi Syncfusion, 

Please add example of how to get/set values for editors HTML5/JavaScript controls for another event. For example when I click button. The editors controls may be initialized when the page is ready. 

Thanks

1 Reply

HP Harikrishnan P Syncfusion Team May 7, 2015 07:08 AM UTC

Hi Edgar,

Thanks for using Syncfusion products.

Query: Please add example of how to get/set values for editors HTML5/JavaScript controls for another event. For example when I click button. The editors controls may be initialized when the page is ready.

We would like to inform you that, each of our components properties can be set or get dynamically. For editor components we have a property called ‘value’. Using this property we can set/get the values of editor components. Please refer the following code,


<script type="text/javascript">

var currencyObj;

$(function () {

$("#currency").ejCurrencyTextbox(

{

name: "currency"

});

//Object for currency textbox created

currencyObj = $("#currency").data("ejCurrencyTextbox");


});



function setValue() {

//Value is set to the currency textbox

currencyObj.option("value", 500);

//Value obtained from EJ currency textbox

var currencyValue = currencyObj.option("value");

alert("Currency textbox value is: " + currencyValue);

}

</script>


Similarly for other editors like numeric, percentage or any other textbox components we can set/get the values using the ‘value’ property. For your convenience we have attached a sample in the following location.

Sample Location : Editor Sample

You can refer the following online documentation to know about the general syntax for getting and setting the properties.

http://help.syncfusion.com/ug/js/Documents/accessingthecomponentpropertiesdynamically.htm
Please let us know if you have further queries.

Regards,
HariKrishnan

Loader.
Live Chat Icon For mobile
Up arrow icon