Alright,
If the client has javascript disabled, I want to print out a hidden form field to the form, that says it is..
Something like
<If JS is Disabled>
print <input type=hidden name=NO_JS value=true>
</If>
Anyway to do this?
| SitePoint Sponsor |





Alright,
If the client has javascript disabled, I want to print out a hidden form field to the form, that says it is..
Something like
<If JS is Disabled>
print <input type=hidden name=NO_JS value=true>
</If>
Anyway to do this?
Eric Coleman
We're consentratin' on fallin' apart
We were contenders, now throwin' the fight
I just wanna believe, I just wanna believe in us




do the opposite...
Code:<script type="text/javascript"> document.write('<input type="hidden" name="JSenabled" value="true">'); </script>





Wayne,
That still shows the input field in the source, so when I submit the form, won't it still be there?
Eric Coleman
We're consentratin' on fallin' apart
We were contenders, now throwin' the fight
I just wanna believe, I just wanna believe in us


This way it should work with older browser as well
<form name="JavaScriptForm">
<input type="hidden" name="JSenabled" value="False">
</form>
<script language="javascript">
document.JavaScriptForm.JSenabled.value="true";
</script>
Thomas Oeser - Blueprint Software
Web Scripting Editor v 5.2 One cool Web editing tool.
3dcomputergraphics.com Coming Soon!
+Originally posted by Zaire
Wayne,
That still shows the input field in the source, so when I submit the form, won't it still be there?
A browser with javascript enabled ignores all tags within <noscript></noscript> so while it is in the source it would be the same as if you surrounded it in quote tags and is ignored.


But not all browsers support the noscript tag. My method would give you the right answer either way.A browser with javascript enabled ignores all tags within <noscript></noscript>
Thomas Oeser - Blueprint Software
Web Scripting Editor v 5.2 One cool Web editing tool.
3dcomputergraphics.com Coming Soon!





Thanks everyone for your responses,
I didn't know that <noscript> wasn't supported by all browsers..
ThomasAesir, I'll try your method, thank you.
Eric Coleman
We're consentratin' on fallin' apart
We were contenders, now throwin' the fight
I just wanna believe, I just wanna believe in us
Bookmarks