Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Problem with FF 2.0

Clicking on the button makes FF 2.0 to reload page. Any idea?
Here is the code;
<html>
<head>
<title>Test</title>
</head>
<body>
<br />
<div align="center">
<form>
<table border="0" cellpadding="5" bordercolor="#FFFFFF">
<tr>
<td align="center" colspan="2">
<button id="log_in" onclick="document.getElementById('status').innerHTML = 'clicked';">
Log In
</button>
</td>

</tr>
<tr>
<td></td>
<td>
<div id="status"></div>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>

Regards;
Stephen
[854 byte] By [swmk] at [2007-11-11 9:49:16]
# 1 Re: Problem with FF 2.0
I see nothing in your code snippet that would force a reload. Can you give a live link to the site?
tgreer at 2007-11-11 23:34:32 >
# 2 Re: Problem with FF 2.0
Oh, I've solved this by adding return false; after function call.
swmk at 2007-11-11 23:35:32 >
# 3 Re: Problem with FF 2.0
That should only be required if the button is a SUBMIT button. FF2.0 must treat a generic button as a submit button... if it's the only button? Very strange indeed.
tgreer at 2007-11-11 23:36:36 >