Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / July 2007



Tip: Looking for answers? Try searching our database.

IE select() and form submittion issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
stat_holyday@hotmail.com - 31 Jul 2007 20:31 GMT
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 news:
It all works perfectly in Mozilla.

The Bad news:
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::
Rik - 31 Jul 2007 20:57 GMT
> <iframe ......id="chatForm"....
> scrolling="no" ></iframe>
>
> <form id="chatForm"

Well, I'd say sort this dublicate ID out first.
Signature

Rik Wasmus

Rik - 31 Jul 2007 21:04 GMT
>> <iframe ......id="chatForm"....
>> scrolling="no" ></iframe>
>>
>> <form id="chatForm"
>
> Well, I'd say sort this dublicate ID out first.

Oh, and BTW: I'd use the onSubmit event of the form, not a button that  
might be clicked...
Signature

Rik Wasmus

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.