473,378 Members | 1,680 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

add submit functionality to the img button

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

Jul 25 '07 #1
4 2878
On Jul 25, 8:05 pm, alcool <fabio.mare...@gmail.comwrote:
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

Jul 25 '07 #2
Rik
On Wed, 25 Jul 2007 12:05:24 +0200, alcool <fa***********@gmail.comwrote:
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
Jul 25 '07 #3
The Natural Philosopher said the following on 7/25/2007 8:18 PM:
Randy Webb wrote:
>alcool said the following on 7/25/2007 6:05 AM:
<snip>
>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/
Jul 26 '07 #4
Rik wrote:
On Wed, 25 Jul 2007 12:05:24 +0200, alcool <fa***********@gmail.comwrote:
>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, <f8*******************@news.demon.co.uk>
Aug 1 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bob Lehmann | last post by:
Hi, I pretty sure I've seen this problem addressed before, but I can't find any references. The short story is that I have I have multiple submit buttons on a page, each providing different...
1
by: jrefactors | last post by:
When the user type something in text box, and press enter, it will submit the form data to test2.jsp, even without pressing submit form button. This is not what I want, I want to submit the form...
16
by: Ben Sharvy | last post by:
I want to get the user's choice of some menu items, and pass them to a (PHP) page in the URL, rather than with "Submit" button. I tried this, but it doesn't work: <a...
8
by: bettina | last post by:
I want to submit a form but without a submit button. That's to say, I want that by giving a definite code in a field and then press <ENTER> the form will be submitted. For Example <form...
6
by: Lloyd Dupont | last post by:
I have a web form with multiple part. I do want the user to click the submit button to post back, so I know which functionality was triggered. unfortunately, when the focus is any text box, if...
4
by: Dmitry Korolyov [MVP] | last post by:
When we use btnSubmit.Attributes = "javascript: this.disabled=true;" to make the button disabled and prevent users from clicking it again while form data still posting, there is no longer...
2
by: Sanjeeb Sarangi | last post by:
I have got a couple of Serverside Button Controls in a page. Each button performs different actions, e.g. Button1 performs Submit, Button2 performs Cancel etc. Now, I want the default button mapped...
0
by: Wysiwyg | last post by:
Hi, I just thought I'd post this since I didn't see anyone else doing it this way. I wanted to be able to force the enter key to submit the form without manually changing the html form, In my...
3
by: Taras_96 | last post by:
Hi everyone, I've got a rather unconventional architecture that I'm having problems with... I have a form called "searchForm", that has an input of type "submit" (with name = "submitButton...
11
by: Harvey Waxman | last post by:
How can I disable a submit button for a form if JS is disabled. In other words, JS must be enabled to submit the form. Thanks Harvey -- http://righttax/blog
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.