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.


8 Years
Discussion Span
Last Post by fxm

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

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

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

works in 'all' browsers.

<form name="frmDetails">
<input type=text size=3 maxlength=3 name=java>
<input type=button name=again value="Refresh?" onclick="details();">
<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"; 

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


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.