![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: Oct 2005
Posts: 54
Rep Power: 4
![]() |
Newbie in Javascript
Hello all!
I am starting to use JS a couple of days now and mainly I am interested in using it in form validation and to create pop-ups. I have 2 questions : 1) If a user doesn't have JS enabled, how will I check for empty fields in the form and show an alert box that prompts for corrections? 2) Also, I have seen sites that have the following : There is a link somewhere which works like this : [a] if you have JS enabled, it "recognizes" it and gives a pop-up window when clicked whereas [b] if you don't have JS enabled, it simply acts like a link and opens a new window (not a poup-up one). Because I am a bit confused, I am staring to think that maybe JS causes more problems than it solves... Should a programmer use it or ,for instance, do a form validation in another page and don't count on the user having JS enabled? |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
If JS is disabled, you'll be doing no client side validation. Even if you validate client-side, you should also re-validate server side. User communication for corrective action, is a matter of request/response, which is less desirable than on-client interaction, but there you have it. If JS is disabled, it's disabled. You either deal with it or toss the customer.
Investigate the <noscript> tag, meta tags, and redirection, for your other question.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|