Connecting Tech Pros Worldwide Help | Site Map

add submit functionality to the img button

alcool
Guest
 
Posts: n/a
#1: Jul 25 '07
hi,
I would like use a image button like a submit button in a form.
it is possible to do

i.e. (in the end of a form)

<a href="" onClick="funcSubmit()"><img src="../immagini/save.png"
alt="Save" /></a>ù

I hope in your suggestion


bye

RobG
Guest
 
Posts: n/a
#2: Jul 25 '07

re: add submit functionality to the img button


On Jul 25, 8:05 pm, alcool <fabio.mare...@gmail.comwrote:
Quote:
hi,
I would like use a image button like a submit button in a form.
it is possible to do
>
i.e. (in the end of a form)
>
<a href="" onClick="funcSubmit()"><img src="../immagini/save.png"
alt="Save" /></a>ù
If you were to do that, why bother with the A element?

<img onclick="funcSubmit()" ... >

And those without script support, or for whom your script doesn't
work, can't submit the form.


--
Rob

Rik
Guest
 
Posts: n/a
#3: Jul 25 '07

re: add submit functionality to the img button


On Wed, 25 Jul 2007 12:05:24 +0200, alcool <fabio.maresca@gmail.comwrote:
Quote:
hi,
I would like use a image button like a submit button in a form.
it is possible to do
>
i.e. (in the end of a form)
>
<a href="" onClick="funcSubmit()"><img src="../immagini/save.png"
alt="Save" /></a>ù
>
I hope in your suggestion
Just curious, why is this not ok for your purpose:

<input type="image" src="../immagini/save.png">

??
--
Rik Wasmus
Randy Webb
Guest
 
Posts: n/a
#4: Jul 26 '07

re: add submit functionality to the img button


The Natural Philosopher said the following on 7/25/2007 8:18 PM:
Quote:
Randy Webb wrote:
Quote:
>alcool said the following on 7/25/2007 6:05 AM:
<snip>
Quote:
Quote:
>No need to use a link when images in modern browsers support the
>onclick. But, if the only way to submit the form is with JS, what
>happens if JS is disabled or not supported?
>>
>
I know of at least one site where the javascript is so broswer dependent
that that is effectively the case. Still has to be viewed with IE6.
IE only sites are a dime a dozen on the web. All they are good for is to
show the ignorance of designing an IE only site.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#5: Aug 1 '07

re: add submit functionality to the img button


Rik wrote:
Quote:
On Wed, 25 Jul 2007 12:05:24 +0200, alcool <fabio.maresca@gmail.comwrote:
Quote:
>I would like use a image button like a submit button in a form.
>it is possible to do
>>
>i.e. (in the end of a form)
>>
><a href="" onClick="funcSubmit()"><img src="../immagini/save.png"
>alt="Save" /></a>ù
>>
>I hope in your suggestion
>
Just curious, why is this not ok for your purpose:
>
<input type="image" src="../immagini/save.png">
It can only be being backwards-compatible to pre HTML-4-UAs with the
tradeoff of not providing graceful degradation for script-incapable UAs.


PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not the
best source of advice on designing systems that use javascript.
-- Richard Cornford, <f806at$ail$1$8300dec7@news.demon.co.uk>
Closed Thread