Witam,
mam problemy ze zdarzeniem onkeyup.
Mam edytor tinymce i w tej textarenie chcę dodać nowe zdarzenie aby funkcja test() się odpalała ale niechce.
Firebug nic mi nie pokazuje, próbowałem bez tinymce i działa wiecie może co jest nie tak?
tinyMCE.init({
mode : "textareas",
theme : "advanced",
content_css: 'szymon.css',
formats: {
smallcaps: {inline : 'span', 'classes': 'small-caps', styles : {fontvariant : 'small-caps'}},
},
theme_advanced_buttons1 : "mybutton,bold,italic",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
remove_linebreaks : false,
entities: "160,nbsp",
plugins : 'inlinepopups',
plugins: 'wordcount',
setup: function( ed ) {
ed.addButton('smallcaps', {
title: 'Small-caps',
image: 'http://wordpress3.localhost/wp-content/plugins/img/letter.gif',
onclick: function(){
ed.focus();
ed.formatter.toggle( 'smallcaps' );
}
});
// Highlight the smallcaps button when the cursor is on small-caps text
ed.onNodeChange.add(function(ed, cm, e) {
// Activates the link button when the caret is placed in a anchor element
cm.setActive('smallcaps', ed.formatter.match('smallcaps'));
});
}
});
function test() {
{
var x=document.getElementById("elm1").value;
var as = x.replace(/ /g, "");
var ass = as.replace(/<strong>/g, "");
document.getElementById('try').innerHTML= ass;
alert(ass);
}
}
Kod
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<textarea id="elm1" name="w" onkeyup='test();' rows="15" cols="80" style="width: 80%">
</textarea>