Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve values from form without a submit button

Status
Not open for further replies.

EMax1

MIS
Apr 8, 2004
95
US
Hi,
I have a form without a submit buton.
In this for I have a few buttons (named 'radiobutton'), and one area map. Cliking on the area map will direct to a page that process the information from the form.
I pass one value when I click on the area map (...xxx.asp?loc=1), but I cannot retrieve the value of the radiobutton. I believe because I am not using a submit button.
How can I retrieve the value selected with the radiobutton?
thanks in advance and I hope I explain to you what I am looking for.
Thanks in advance
 
The short of it is... you can't. You are talking about an image-map. When you click that map you follow a link to another page... you are not submitting the form at all (as you correctly said... you would need to press the submit form for that to happen).

Now the long of it is that there are indeed solutions available to you...
- You could attach an onclick event to the radio button and use it to alter the image-map's href (to include the extra parameter).
- You could set a cookie value with the onclick.
- You could modify the underlying href for the iimage-map to run a javascript function that first gathers the radio button state.

I would probably go for the last of my suggestions... because you can just add an onclick to the href. But that does require that your users have javascript enabled. Having said that, I don't see that you have a choice [smile]

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
There's another solution available that would complicate the server side processing a bit, but not much. Your friend is
Code:
<input type="image" />
With that you can put an image in the submit button (your image map) and when you click on it, coordinates are sent to the next page. What are the benefits of this solution?

1. Does not require any JavaScript.
2. You can use POST instead of GET which is a little more secure.
 
The downside to Vragabond's suggestion (the server-side complications he mentioned) are that you will have to convert the X and Y coordinates into something meaningful yourself, rather than have the image map do it for you. Still, I think it is probably your best bet.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top