0

Hey guys, what I want to do is have a page that only displays if javascript is enabled(or similar) in the sense that it tells users that js is not enabled and how to enable, what were doing is creating web forms and would only like them viewable if js is enabled so that we can validate client side and reduce server load.

Main reason is validation client side, cause if the initial form works well we will expand it to include forms for every type of job we can.

No idea to where to start as js is not a strong point.

Cheers

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by fxm
0

Start by looking up the <noscript></noscript> tags.

Note: although technically not 'legal', a construct in the <head> section like

<noscript>
    <meta http-equiv="refresh" content="0;url=altpage.html">
</noscript>

works in 'all' browsers.

-1
<form name="frmDetails">
<input type=text size=3 maxlength=3 name=java>
<input type=button name=again value="Refresh?" onclick="details();">
</form>
<head>
<script language="javascript" type="text/javascript">
function details() { 
if (navigator.javaEnabled() < 1) document.frmDetails.java.value="No"; 
if (navigator.javaEnabled() == 1) document.frmDetails.java.value="Yes"; 
}
</script>
</head>

The above code shows the result of java enable/disabled status. Based on the result make a condition to display/hide the page.

0

The above code shows the result of java enable/disabled status.

Java != javascript.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.