Click here to Skip to main content
15,885,182 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
if i've disabled the JavaScript addins in my browser(manually), (the web site has the JavaScript validation)

now my validation is skipped. how to over come this issue?
Posted

1 solution

You have 2 options here, the first is that you can require site users to use JavaScript, and this is the route that I would suggest.

The other route is a parallel deployment of a non-JavaScript version of your forms that have more robust server-side validation. This is generally a bad idea, and you should have robust validation on the server side anyway.

Normally I'll setup a nested page in my primary view that will be called by AJAX, and can display an error instead if JavaScript is disabled.

For example, with jQuery:
HTML
<!DOCTYPE html>
<html>
    <head>
        ...
        <script type="text/javascript">
            $(function(){
                $.ajax({
                    url: 'my nested view',
                    success: function(data){
                        $('#content-wrapper').html(data);
                    }
                });
            });
        </script>
    </head>
    <body>
        <div id="content-wrapper">
            <noscript>
                <p>You must turn on Javascript or use a JavaScript-capable
                browser to use this site</p>
            </noscript>
        </div>
    </body>
</html>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900