i'm desperately trying to access the textarea within ajax-requests.
the code (php page):
update_text.php works just fine (as i see when alerting these text values).
- Code: Select all
$(document).ready(function() {
$.ajaxSetup({
url: 'update_text.php',
type: 'POST'
});
$('.wymeditor').wymeditor({
html: "", //doesn't help if omitted / commented out
preInit: function(wym) {
$.ajax({
data: {txt:'', action:'init'},
success: function(ret) {
//$('.wymeditor').empty();
$('.wymeditor').val(ret); //doesn't work
//alert(ret); //works
}
});
},
postInit: function(wym) {
$('.wymupdate').click(function() {
var temp = $('.wymeditor').val();
$.ajax({
data: {txt:temp, action:'save_and_load'},
success: function(ret) {
//alert(ret);
$('.wymeditor').val(ret); //doesn't work either
}
});
});
}
});
});
the form:
- Code: Select all
<form action="#" method="post">
<textarea class="wymeditor"></textarea>
<input type="submit" class="wymupdate" value="update" />
</form>
i tried
- Code: Select all
wym.html
- Code: Select all
wym.html(ret);
- Code: Select all
wym.html = ret;
somebody any solutions how to assign the read text values to the editors textarea?
thanks a lot.