| 4:13 pm on Aug 29, 2006 (gmt 0)|
I think what you already have is correct, if you are wanting an image to submit a form then using:
is the way to go. This is a submit btn. It behaves the same as an <input type="submit"... and you can also add a alt and title attributes to give your users some popup text.
If, however, you want to submit a form that is on the page, but from an image (click) which is not within that form, then you can do...
|<form name="myform"... |
<img src="mybutton.gif" onclick="myform.submit();">
But personally, I would stick to the first example, with type="image" if possible.
ASIDE: I've found that a submit button with type="image" is not passed to PHP, key/value pairs?! Am I missing something?!
| 6:12 pm on Aug 29, 2006 (gmt 0)|
Anyone reading can ignore that last ASIDE note above, as I've found the answer was actually in the question... I was missing the value attribute from the <input> tag, so naturally the key/value pair wasn't generated! Oops!
| 6:57 pm on Aug 29, 2006 (gmt 0)|
I must not have been clear. I can get this to work if I use the "form" trick. (although specifying "alt" text is not getting me the tooltip popup text for some reason).
What I'm trying to do is achieve the same affect as if it was a form, but having it only as an <a href> link.
In other words, it's just an image attached to a link. I still want to hear the "click" sound.
I hope it was clearer.
| 10:21 pm on Aug 29, 2006 (gmt 0)|
You'll need to specify a title="Popup text here" attribute in your <input> tag to get a popup message.
But it's the 'click' *sound* you are after?! My machine does not make any sound when I click on a (submit) button, whether it's in a form or not, and my machine is pretty much in its default configuration as far as that sort of thing goes.
Whether a users machine makes a click sound on a standard HTML form submit is very much down to the users individual machine - I think!
| 10:46 pm on Aug 29, 2006 (gmt 0)|
Really? I've had lots of machines, they all "click"....
but that "title" thing is helpful, thanks!
| 1:54 am on Aug 30, 2006 (gmt 0)|
The click sound is probably a feature of the browser you are using and its configuration. For instance, on my machine Firefox is generally silent while Konqueror makes all manner of odd grunts, clicks and squeals.
| 10:24 am on Aug 30, 2006 (gmt 0)|
Hhhmmm, yeah... just out of interest... I do get a click sound from IE5 on Win98 when clicking on links, but *not* on form submits. (The system sounds on that machine have probably been configured in the past.) In all other cases, I get no click sound at all... Win98 - FF, Opera7, N4(!). WinXP - IE6, FF, Opera8. (And I've got the volume turned way high!)
I did wonder about ASCII code 7 (maybe ) which is historically a 'beep' but that doesn't seem to work!
The other possibility maybe to embed a sound (a small .WAV file) into a page with EMBED/BGSOUND and somehow trigger the sound (change the SRC attribute perhaps) via the onclick event of the link. But it seems like a lot of work for something which 'might' work on 'some' machines - and people could find annoying.
| 5:50 pm on Aug 30, 2006 (gmt 0)|
Is it possible to catch a mouse click while a script is running, like an AJAX update, then play a sound to indicate the erant click will not be responded to?
| 7:12 pm on Aug 30, 2006 (gmt 0)|
I just tested it and it turns out my brain "remembered" a click sound and I assumed it was in Firefox, but it was a memory from ie. The brain really plays weird tricks on you. Or I'm just getting old..