function sendComment() { if($('text').value!='' && $('name').value!='') { var myHTMLRequest = new Request.HTML({url:'../blog_comment',encoding: 'utf-8', onSuccess: function(html) { //Clear the text currently inside the results div. $('content').set('text', ''); //Inject the new DOM elements into the results div. $('content').adopt(html); } }).post($('comment')); $('text').value=''; $('name').value=''; } else alert('Bitte alle Felder ausfüllen'); }