Odd problem

liunx

Guest
I have made a chatbox, but it has a really annoying and odd problem:<br />
I use forms to retrieve information, I have a input to get the user's name, and next the this input I have a submit button with the value "log in". If you CLICK on the button, it works correclty, but when you use enter (with the button selected), it's like the page refreshes itself :S. This is the chatbox: .<!-- m --><a class="postlink" href="http://members.lycos.nl/hawkagent/v2/htmlchat/chatbox.htm">http://members.lycos.nl/hawkagent/v2/ht ... hatbox.htm</a><!-- m --> .<br />
I hope somebody can help me with this problem<!--content-->I see another submit button on the same page (Change), and there is no opening form tag associated with that button.<br />
<br />
Also, when there is more than one submit button on a page I am not sure how the browser determines which submit button to use when the enter key is pressed, not sure if it will see the first submit button or the last.<!--content-->First thing I noticed was the refresh rate of 3 seconds, how annoying !!!<br />
<br />
I would take the refresh out of the code interval=3, to me 3 seconds is very fast and wouldnt allow a user time enough to login before refreshing the page. If you have to have a refresh rate, try something more like 60 seconds, unless someone more experienced here has a better idea !!<br />
<br />
Neil Australia<br />
<br />
<body><br />
<iframe src=http://www.htmlforums.com/archive/index.php/"login.php" height="150" width="100%" style="overflow-x : hidden;"> </iframe><br />
<br><br />
<iframe src=http://www.htmlforums.com/archive/index.php/"output.php?interval=3" width="100%" height="400"></iframe><br />
</body><br />
</html><!--content-->I see another submit button on the same page (Change), and there is no opening form tag associated with that button.<br />
Also, when there is more than one submit button on a page I am not sure how the browser determines which submit button to use when the enter key is pressed, not sure if it will see the first submit button or the last. <br />
Try here: <!-- m --><a class="postlink" href="http://members.lycos.nl/hawkagent/v2/htmlchat/login.php">http://members.lycos.nl/hawkagent/v2/htmlchat/login.php</a><!-- m --> . Here is only 1 submit button, but the same problem :S<br />
<br />
<br />
First thing I noticed was the refresh rate of 3 seconds, how annoying !!!<br />
<br />
I would take the refresh out of the code interval=3, to me 3 seconds is very fast and wouldnt allow a user time enough to login before refreshing the page. If you have to have a refresh rate, try something more like 60 seconds, unless someone more experienced here has a better idea !!<br />
<br />
lol, the outputpage of the chatbox (the messages) is the only page that is refreshing, the loginpage isn't refreshing at all :)<!--content-->works fine for me, even when the submit button is not highlighted.<!--content-->:confused: I have asked my friends to try it, but they also have the problem... What browser and version do you have scoutt?<!--content-->it doesnt work on ie 6<!--content-->mozilla 1.5<br />
<br />
also with the submit button highlighted it works for me in IE6 as well.<br />
<br />
BUT, you have an error<br />
<br />
Error: document.loginform.login has no properties<br />
<br />
that is present in mozilla and IE. seems to me tha tyou can't force a focus if the object has not loaded yet.<br />
<br />
if you try it in IE and it appears to refresh try hitting your refresh button from there. you will see that the form actually submitted as IE tells you it can't refresh without submitting the form again. your logic in the php script might be at fault.<!--content-->Originally posted by scoutt <br />
mozilla 1.5<br />
<br />
also with the submit button highlighted it works for me in IE6 as well.<br />
<br />
BUT, you have an error<br />
<br />
Error: document.loginform.login has no properties<br />
<br />
that is present in mozilla and IE. seems to me tha tyou can't force a focus if the object has not loaded yet.<br />
<br />
if you try it in IE and it appears to refresh try hitting your refresh button from there. you will see that the form actually submitted as IE tells you it can't refresh without submitting the form again. your logic in the php script might be at fault. <br />
<br />
There is no object 'login' that is why the error. The button is named "submit", not "login".<br />
<br />
<br />
<body OnLoad='document.loginform.login.focus()'><br />
<table width="100%" height="100" border="0"><br />
<form name="loginform" action="login.php" method="post"><br />
<tr><br />
<td bgcolor="DEDBE7"><br />
Nickname: <br />
<input type="text" name="nickname" size="40"><br />
<input type="submit" name="submit" value="Log in"><br />
</td><br />
</tr><br />
</form><!--content-->kevin he is just trying to get cursor in the textbox, not on the submit button.<br />
<br />
is should actually be<br />
<br />
<body onLoad='document.loginform.nickname.focus()'><br />
<br />
I believe that is what he wants.<!--content-->Originally posted by scoutt <br />
kevin he is just trying to get cursor in the textbox, not on the submit button.<br />
<br />
is should actually be<br />
<br />
<body onLoad='document.loginform.nickname.focus()'><br />
<br />
I believe that is what he wants. <br />
<br />
Could be... :)<!--content-->
 
Back
Top