Richard Cornford wrote:
aj****@googlemail.com wrote:
>The following cgi generated html page has the following
Javascript in the Body section:-
<script language="JavaScript" type="text/javascript">
<!-- Begin
function eHistorical()
{
document.F1.action="http://www.somedomain/historicalitems.htm";
F1.submit();
}
//-->
</script>
Further down the page we have the following Form :-
<form name="F1">
JFTR: The `action' attribute is #REQUIRED, and missing here.
><p align="right">
<input type = "button" name="B2" value = "Historical Items"
onclick ="eHistorical()">
</p>
</form>
The page loads OK but when button B2 it clicked the
following error is
reported by Firefox :-
[...]
[...] There is no need to involve javascript in this
at all, and if you don't you will certainly not get any javascript
issues. Consider:-
<form action="http://www.somedomain/historicalitems.htm">
<p align="right">
<input type="submit" name="B2" value="Historical Items">
</p>
</form>
To satisfy the requirements of HTML 4.01 Strict (else you would not need any
of it), one should use DIV instead of P here, for there is no running text
inside a paragraph. Also, CSS text-align:right MUST then be used instead of
the deprecated `align' attribute; with HTML 4.01 Transitional, it only
SHOULD be used.
Another variant, IMHO the better one, is not to use a form in the first
place, and to use a styled hyperlink instead. That way the user could also
be informed about the visit status of the target resource in an accessible way.
- without any scripting at all.
Full ACK.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16