I have a textarea text field. I need that when you press Enter, the data of this form is sent by the POST method to the file "ajax.php". As you understand, you need to do this with js and ajax.
<script> function getXmlHttp(){ var xmlhttp; try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); } return xmlhttp; } function sendAjax(textSend){ if((event.keyCode==10)||(event.keyCode==13)) { /************************************/ } textSend.value=''; } </script> <textarea onkeydown="sendAjax(this)"></textarea>
instead of these asterisks you need to put the necessary code. Thanks in advance