-6

After applying client side validation on page, if browser JavaScript option has been disabled then all page validation/function are dead. So I need a JavaScript function, that automatically enables and disables JavaScript of any browser, it should run on my page and work on every browser.

Andrea Casaccia
  • 4,802
  • 4
  • 29
  • 54
Abhishek
  • 69
  • 2
  • 9

2 Answers2

3

Your requirement is impossible to achieve. Among other considerations, how do you pretend to enable javascript in a browser where javascript is disabled using javascript?

Oscar
  • 13,594
  • 8
  • 47
  • 75
0

What you should do is detect that javascript is disabled and degrade your application to do validation in server side instead of client side.

Oscar
  • 13,594
  • 8
  • 47
  • 75
  • :Only change status of checkbox disabled to enabled,that's it? – Abhishek Aug 26 '13 at 10:35
  • I don't understand what you mean. – Oscar Aug 26 '13 at 11:08
  • If i apply client side validation on my html page and if my mozilla browser js option disabled then, if i write some js function to enabled that checkbox,then is it possible or not? – Abhishek Aug 26 '13 at 11:13
  • No man, NO! It isn't possible! As I said, if js is disabled, you have to validate at SERVER SIDE. Forget about changing browser options, you can't! – Oscar Aug 26 '13 at 13:12