954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How would I display somethign only if javascript is enabled?

Hi

I'm getting a few spammers bypassing certain form elements on my site which I attribute to them having javascript disabled. Is there any way of diplaying the content if it's enabled and otherwise displaying a message saying "We are no longer taking registrations".

I'm not too concerned about losing the 10% of regular web surfers who have javascript disabled .

Last but not least is there any way of checking to see if javascript is enabled before a form action is processed?

Thanks a lot :)

cormee
Newbie Poster
21 posts since Mar 2007
Reputation Points: 10
Solved Threads: 3
 

Easy, have JavaScript write that part of the page. If JavaScript is turned off, they'll never see it. That's a core principle of progressive enhancement.

stymiee
He's No Good To Me Dead
Moderator
3,360 posts since May 2006
Reputation Points: 161
Solved Threads: 38
 

I was going to suggest that too.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

That might make his site extremly slow wouldnt it??


Trying to force ppl to use scripts isnt a good idea cause it causes problems,there are other anti spam measures you can enable though that would weed out spam bots........

The Dude
Nearly a Senior Poster
3,485 posts since Dec 2005
Reputation Points: 1,054
Solved Threads: 31
 
Trying to force ppl to use scripts isnt a good idea cause it causes problems,there are other anti spam measures you can enable though that would weed out spam bots........

I ended up doing something completely different and it seems to work so the problem is solved hopefully - thanks for everyones suggestions :)

cormee
Newbie Poster
21 posts since Mar 2007
Reputation Points: 10
Solved Threads: 3
 

Very good :)

The Dude
Nearly a Senior Poster
3,485 posts since Dec 2005
Reputation Points: 1,054
Solved Threads: 31
 
I ended up doing something completely different and it seems to work so the problem is solved hopefully - thanks for everyones suggestions :)

How did you solve? I'm also having the same problem...

Karthik_pranas
Posting Pro
564 posts since Feb 2011
Reputation Points: 96
Solved Threads: 97
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You