function sendRequest() { new Ajax.Request("http://www.hotelvictoria.nu/sparakommentar.php", { method: 'post', postBody: 'kommentar='+ $F('kommentar')+'&slug='+ $F('slug'), onComplete: showResponse }); } function showResponse(req){ $('show').innerHTML= req.responseText; } function tooLong(maxl,item_id) { if (document.getElementById(item_id).value.length >= maxl) { document.getElementById(item_id).value = document.getElementById(item_id).value.substr(0,maxl); document.getElementById(item_id).focus(); return false; } }