jQuery live preview form load directly after mysql query
I found a great jQuery Code on this page and used it on my site. It works great. A form and a live Preview with the jQuery. But now when i want to update the db and open the form again it will correctly put the text in the formfields, but the preview only starts after i click in and out of the field. How can i force my function to start the preview directly after the mysqli query?
$(document).ready(function() {
var commentNode = $('#lp-comment'),
contactNode = $('#lp-contact'),
contact = $('#contact'),
website = $('#website');
//comment...easy
$('#live-preview-form input, #live-preview-form textarea').bind('blur keyup',function() {
//comment
commentNode.text($('#comment').val());
commentNode.html($('#lp-comment').html().replace(/\n/g,'
'));
contactNode.text(contact.val() + ' says:');
});
});
$(document).ready(function() {
var commentNode = $('#lp-comment'),
contactNode = $('#lp-contact'),
contact = $('#contact'),
website = $('#website');
//comment...easy
$('#live-preview-form input, #live-preview-form textarea').bind('blur keyup',function() {
//comment
commentNode.text($('#comment').val());
commentNode.html($('#lp-comment').html().replace(/\n/g,'
'));
contactNode.text(contact.val() + ' says:');
});
});