[Solved] ReadOnly cannot receive any value

[Solved] ReadOnly cannot receive any value

BernardoLimaBernardoLima Posts: 20Questions: 0Answers: 0
edited March 2013 in Editor
The following code works properly when I use a "text" type field as a target of the "editor.set" function, but when I change it to a "ReadOnly" field, it does nothing, even the alert box does not shows up.

I have also tried to use !this.get("TEXT_TYPE_FIELD_Z") to get a field value but it's not working, how can I get the input on a text field?
And how can I convert it to integer to multiply it?

[code]
editor.on('onOpen', function () {
$(document).bind('keyup', function (e) {
if ( e.keyCode >= 0 ) {
editor.set("TEXT_TYPE_FIELD_A", "If you can see this, is working");
alert("It worked");
}
} );
} );
[/code]

Replies

  • BernardoLimaBernardoLima Posts: 20Questions: 0Answers: 0
    My mistake, I have inserted a non existing field
    Anyways, here's the solution:

    $( 'input', editor.node( 'ch' )).on( 'change', function () {
    if ( editor.get( 'ndepessoas' ) > 0 && editor.get( 'ch' ) > 0 ) {
    editor.set( 'hht', "My new value" );
    }
    } );
This discussion has been closed.