Solved

Form submit using image outside the form

Posted on 2000-03-18
2
320 Views
Last Modified: 2013-12-25
I have one image (gif) and a form on my page. The image is outside the form region. I want to make this image a "clickable area" and issue a form submit when the user click on this image.

Is it possible?

I am using JavaScript at client, and VBScript and ASP at the server.
0
Comment
Question by:rdaudtnt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
CoolAss earned 50 total points
ID: 2631933
Sure. First, make the image a normal link as in:

<A HREF="#"><IMG SRC="myimage.gif"></A>

Now do this:

<A HREF="#" onClick="document.forms('formname').Submit()"><IMG SRC="myimage.gif"></A>

That should do it. My Javascript is a little rusty, but it's more or less that.
0
 
LVL 1

Expert Comment

by:damianosky
ID: 2635881
Yes, CoolAss, this is a nice solution. You can also improve it (if, e.g, you want fields validation) calling in the on Click event a javascript function were you validate data and then, at the end of the function, if all is OK you give the command:

document.forms('formname').Submit()

Recent browsers support also this syntax:

document.formname.Submit()

Good work!

0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

742 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question