Possible Duplicate:
How to detect if JavaScript is disabled?
How to find whether javascript is supported by user's browser or not
Possible Duplicate:
How to detect if JavaScript is disabled?
How to find whether javascript is supported by user's browser or not
You can use javascript to put some value into a hidden field in your form - if the field has this value on postback, then the browser supports javascript.
document.getElementById("myHiddenField").value = "js is on";
<input type="hidden" />
Another option is to use javascript to add a cookie and look for this cookie on the server side - if it is there, javascript is enabled, if not, it isn't.
I would have suggested <noscript>
, but this doesn't help with your code finding out if javascript is supported (perhaps with an additional form only outputted in there), but this would complicate your client-side and server-side logic.
You cannot check using Javascript if the browser is configured to use Javascript because obviously it can't run:)
So instead you use a <noscript>
tag. This tag will always appear when Javascript is not supported and therefore you can put information within this tag to warn the user to enable Javascript on their browser (if they can).
Oh and this is a possible duplicate of : How to detect if JavaScript is disabled?
Use <noscript>
tag:
<noscript>
Your browser does not support javascript.......
</noscript>
More Info: