RE: [PHP] (was: anchor inside form) js switched on/off

2009-08-25 Thread Arno Kuhl
 
 You can use javascript behind a button or image or link to submit the 
 form from anywhere in your html page. You don't need the anchor but 
 you do need a form name. Something like:
 
   href=javascript:document.FormName.submit();
 
 Cheers
 Arno
 
 
And all it takes for that to break is for someone to turn off Javascript...

Thanks,
Ash
http://www.ashleysheridan.co.uk

-

Ash, from what I've seen you enjoy engaging in a debate. Well here's
something you'll no doubt want to engage in: the number of people who have
javascript switched off vs the number of people using browsers that support
all the latest ajax-type gizmos. I've not seen anyone told not to go the
ajax route, but it's amazing how concerned some people are about whether
javascript is switched on or not (the fact that js is required for ajax
seems to be overlooked). When w3schools was still keeping stats about it
they showed about 5% of users had js switched off (though they conceded the
stats were unreliable - tech types go to w3schools and they're much more
likely to mess with browser settings than the average user). Generally it's
accepted that the average joe doesn't know how to switch js off, or even why
they would want to. When we investigated sites where this is specifically
measured (e.g. a banking site, which I once worked on) users who had js
switched off were prompted to switch it on, and logs showed that 100% of
those users reloaded the page with js switched on (and our stats, during the
launch phase, showed much less than .5% users had js switched off in the
first place). Generally we found that requiring js was a complete non-issue.
I've subsequently found this is true on other sites I've worked on, even
when users are not prompted. With navigation menus using js more frequently
these days and the increased use of ajax, browsing with js switched off is
almost not an option anymore. I'm sure, Ash, you'll tell me how corporate
firewalls strip javascripts - I'd be interested if you can point out an
example and show how common this is. And as for most people telling you js
is a bad idea - is this true? Do you have stats to back up your statement,
or are you just stating your perception as a fact?

A second point, Ash, is that you yourself have mentioned coding javascript,
and have suggested the use of ajax as a solution to others - I presume you
know what the j in ajax is? I've even seen you providing javascript
solutions without any concern as to whether js was switched on or not.
Perhaps your concern about js is selectively applied to certain posts rather
than real-world situations?

BTW I'm not in a debating mood - I've made my point, no doubt Ash you'll
make yours, and I'll leave it at that. But if anyone else has any further
info regarding real-world stats or experience about js switched on or off it
would be very interesting to hear.

Cheers
Arno


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] (was: anchor inside form) js switched on/off

2009-08-25 Thread Ashley Sheridan
I'm not saying Javascript is evil, and yes I do know what the J in AJAX
is, I'm not as stupid as I look! I use it for plenty of things, but as
an aid rather than the core functionality.

As for the firewalls stripping Javascript, I don't have a specific
reference myself, but I've read about it a few times online before, and
for your benefit here is an example
http://www.456bereastreet.com/archive/200612/you_cannot_rely_on_javascript_being_available_period/

I don't have any stats to back this up, but I was led to believe that a
lot of specialist browsers (like Braille browsers) were unable to handle
Javascript, or that a lot of Javascript fails because the event handlers
that are used do not translate well outside of a mouse environment.

I said that Javascript was a bad idea in this case because it's for a
form submission, and if I remember correctly, for some sort of shopping
cart-esque site. Having several submit buttons should be able to cope
with this sort of situation provided it is thought out logically.

I do think it is important to try to cater for as wide an audience as
possible, and if that means making sure things work with essential
functionality when Javascript isn't available then so be it. Javascript
should be there to enhance functionality, not be it. This obviously
can't hold true for some situations (imagine Google Docs without
Javascript!) but a lot are often overlooked. I recall seeing some awful
code at my last job, where somebody had thought it was a good idea to
use Javascript for everything, including ALL form submissions. They'd
even made all links look like this:

a style=cursor: hand; onclick=location.href='somepage.cfm';click
me/a

I'd consider this the worst of the worst, and probably something I'll
never see again, but it has made me wary of any solutions that are
Javascript only.

Thanks,
Ash
http://www.ashleysheridan.co.uk




RE: [PHP] (was: anchor inside form) js switched on/off

2009-08-25 Thread tedd

At 3:00 PM +0200 8/25/09, Arno Kuhl wrote:

-snip-

BTW I'm not in a debating mood - I've made my point, no doubt Ash you'll
make yours, and I'll leave it at that. But if anyone else has any further
info regarding real-world stats or experience about js switched on or off it
would be very interesting to hear.

Cheers
Arno


Arno:

Yes, I have a point and I agree with Ash because he is right. If you 
don't realize that, then that's your problem.


Additionally, I don't think that any of us need a lesson as to what 
the j stand for in ajax -- I'm not sure who you think you are 
talking too on this list, but welcome to my kill file.


tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php