Graphix,
You need to suppress the form's natural tendency to want to be submitted when a field has focus and user hits enter. That's fairly simple to cure because the form (as far as I can see) never needs to be submitted. Two options immediately come to mind:
1. Reduce the <form ...> tag to <form>, and call send_message with
onclick='send_message(this.form.textbox.value)' to make the user-entered text available as an argument to the function.
2. Leave the form tag in place but change it to :
<form name="sendform" onsubmit="return false;">
onsubmit="return false;" ensures that the form will not be submitted, whilst your button's
onclick="send_message()" will still work.
Goood luck
Airshow Last edited by Airshow; Sep 17th, 2009 at 1:48 pm.
Reputation Points: 318
Solved Threads: 358
WiFi Lounge Lizard
Offline 2,526 posts
since Apr 2009