[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

Call a form within an image map?

I have a graphic.  I want users to be able to click on various image maps on the graphic which call up a form.

I want to use standard HTML, no java (unless absolutely necessary) -- to make it as compatible with as many browsers as possible.

Thanks!
0
Rowby Goren
Asked:
Rowby Goren
1 Solution
 
cookmysterCommented:
So, when you click on the images map, it is going to call the page which has the form???
0
 
Rowby GorenAuthor Commented:
No, I want it the button to contain all of the form information that is usually found in a submit button.  I'm posting to a cgi script. (it's for a shopping cart I'm creating.)

I guess the scenereo is somewhat like the following:

People see one big image of an *assortment* of toys.  They click on the toy they want to purchase, and they area taken to the checkout section of a shopping cart.

To repeat: The image map calls up the cgi program (using the standard form peramaters) and are taken to the checkout.  

I assume this can be done.  Right?  Again, I don't want to take them to another page where they then push the form button.  

Thanks!

Rowby
0
 
garrethgCommented:
As long as you're not passing sensitive information how about just passing the parameters as an URL encoded string via the HREF? That's all a form with the get method does anyway.

e.g.
<AREA HREF="
http://www.myDomain.com/myCGI?param1=toy1¶m2=price">
0
 
banjonesCommented:
To avoid the query string, another way would be to have the forms on the page with hidden fields and then submit the relevant form with javascript.
Something like this:

<script language=JavaScript>
 function buyToy (formName) {
   document[formName].submit();
 }
</script>


<form name=teddy method=post>
 <input type=hidden name=toy value=bigTed>
</form>


<area href="javascript:goForm('teddy')">
0
 
banjonesCommented:
The javascript function in the <area> tab should obviously been 'buyToy()'...

Doh!!
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now