Solved

Form submit using image outside the form

Posted on 2000-03-18
2
319 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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.

756 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