Detect Browser settings

Is there a way to detect if the CLient Browser Javascript is disabled?

We have a large application form that folks fill out and there's validation thats JavaScript based.

Works fine if Javascript is enabled.

Works...but allows invalid text if client has J disabled.
lrbristerAsked:
Who is Participating?
 
Todd GerbertConnect With a Mentor IT ConsultantCommented:
I forgot to include this link: http://www.w3schools.com/tags/tag_noscript.asp
0
 
Dave BaldwinFixer of ProblemsCommented:
You need to re-validate on the server too.  Spammers and hackers will collect your form info and post directly to your 'action' page and bypass your validation.
0
 
lrbristerAuthor Commented:
Ok Dave...
If you mean VB code side, I'm wondering why my predescesor didn;t do that to start with.

I will do that. BUt in the meantime, is there a way to do what my question is asking?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
The only way to detect that Javascript is disabled is by it's absence.  But of course, if it's not there, it can't tell you about it.  There is no 1-step way to tell that it is disabled.  Plain HTML isn't going to tell you anything.  The answer is that there is no simple way to know that Javascript is disabled.

As far as server side validation, I don't think any of us did that the first time.  You learn to do it when you find out that the 'bad guys' just skip right around your form and post what they want.  Then it's up to you to block it or filter it.
0
 
Dave BaldwinFixer of ProblemsCommented:
To add to what I said...  I view client side validation as merely an aid to the client to get the form data correct and useful.  I use the server side validation as filtering and protecting the application and database.
0
 
Todd GerbertConnect With a Mentor IT ConsultantCommented:
Use the <noscript> HTML tag to display a message to users with JavaScript disabled, informing them that in order to view the form they must enable JavaScript.

Put the form's contents in a <DIV> that's hidden, and use the page's JavaScript "onLoad" event to show it.

If the user has JavaScript disabled they will see the contents of the <noscript> tag, and the form will never be made visible since the "onLoad" event will never run.

If the user does have JavaScript enabled, they will not see the <noscript> tag's contents, and the "onLoad" event will make the form visible.

Having said that, I agree with DaveBaldwin; I would prefer to do such validation on the server, e.g. in your .Net code-behind, for the reasons he's already mentioned, plus I find it easier to implement and debug (but that may just be my preference).
0
 
lrbristerAuthor Commented:
Thanks guys
0
 
Todd GerbertIT ConsultantCommented:
Hmm, I'm curious as to why the comment that said it couldn't be done was awarded 400 points, and the comment that actually answered your question only got 100?
0
All Courses

From novice to tech pro — start learning today.