IE select() and form submittion issue

S

stat_holyday

Greetings All,

Background:
We've set up a ajax-free version of Shoutbox. The form below posts to
an iframe php file.

Goal:
A user clicks on the text field (chatbarText), types something and
hits enter (or the Send button), and the info is posted to the form.
The onclick event selects the text field so it is highlighted. The
user can see what they've typed previously, but can immediatly start
typing over their old entry.

Good It all works perfectly in Mozilla.

The Bad Does not work in Internet Explorer. The functionality of submitting
the form by pressing the Enter key doesn't work, and the form's field
is not in focus or selected. The form is only submitted if the user
presses the Send button, but again, the field never becomes in focus.
Tested on IE 6.0.28 and IE 7

Question:
What's wrong?

::BEGIN CODE::

<html>
<body>

<script type="text/javascript">
<!--

function select_me() {
document.chatForm.chatbarText.select();
}

//-->
</script>

<iframe src="/modules/mod_shoutbox_iframe.php?
coach=cathy&my_groupid=5&my_name=cathy&chat_full=" width="100%"
height="250" frameborder="0" name="chatForm" id="chatForm"
scrolling="no" ></iframe>

<form id="chatForm" target="chatForm" name="chatForm" method="post"
action="/modules/mod_shoutbox_iframe.php?
coach=cathy&my_groupid=5&my_name=cathy&chat_full=">

<p>Name: cathy<em>

<input type="hidden" name="shoutboxname" id="shoutboxname"
value="cathy" />

<label for="chatbarText">Type your message here:</label><input
type="text" name="chatbarText">
</p>

<input type="submit" id="submitchat" name="submitchat" class="button"
value="Send" OnClick="select_me();"></form>

</body>
</html>

::END CODE::
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top