Ein Formular und eine Live-Vorschau mit der jQuery. Aber jetzt, wenn ich die Datenbank aktualisieren und das Formular erneut öffnen möchte, wird der Text korrekt in die Formularfelder eingefügt, aber die Vorschau beginnt erst, nachdem ich in das Feld hinein und aus ihm heraus geklickt habe. Wie kann ich meine Funktion zwingen, die Vorschau direkt nach der MySQL-Abfrage zu starten?
Code: Select all
$(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:');
});
});
Code: Select all
$(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:');
});
});Code: Select all
Mobile version