SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
-
Jun 25, 2002, 19:33 #1
- Join Date
- Jun 2001
- Location
- In your basement
- Posts
- 1,268
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
sending hidden field if JS is disabled
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
-
Jun 25, 2002, 20:06 #2
- Join Date
- Jun 2002
- Location
- .chicago.il.us
- Posts
- 957
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
do the opposite...
Code:<script type="text/javascript"> document.write('<input type="hidden" name="JSenabled" value="true">'); </script>
-
Jun 25, 2002, 20:19 #3
-
Jun 26, 2002, 07:47 #4
- Join Date
- Jun 2001
- Location
- In your basement
- Posts
- 1,268
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Jun 26, 2002, 07:57 #5
- Join Date
- May 2002
- Location
- Sydney, Australia
- Posts
- 214
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Cross Browser
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!
-
Jun 26, 2002, 08:07 #6
- Join Date
- Aug 1999
- Location
- Lancaster, Ca. USA
- Posts
- 12,305
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
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.
-
Jun 27, 2002, 00:36 #7
- Join Date
- May 2002
- Location
- Sydney, Australia
- Posts
- 214
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
no script
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!
-
Jun 27, 2002, 02:20 #8
- Join Date
- Jun 2001
- Location
- In your basement
- Posts
- 1,268
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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