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

Recommended Answers

All 3 Replies

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.

Member Avatar for rajarajan2017
<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.

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

Java != javascript.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.