Help - Search - Members - Calendar
Full Version: Radio Buttons and Submit Button help.
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
pulp25
Hi, I am in desperate need of help smile.gif

I currently have a form with both a radio button:

CODE
echo <input type='radio' name='interest'
                  value='$type'>


And a submit button:

CODE
<input type='submit' name='Products'
             value='Select Category'>



I do not want to use the radio and submit buttons, I would like all of the same things to happen when a person clicks on an image (instead of checking the radio button and pressing submit). So basically two values for one action...

So far I have tried this, but know I am way off, because this only contains the name of the old radio button and not the submit:

CODE
echo "<input type='image' border='0' name='interest'
                  value='$type' src='../system/13/uploads/$type'>



Is there anyway to do this? I will be in debt to anyone who can help me.


Darin McGrew
A lot depends on the server-side program that processes the form. If it requires method="post" then you can't. If it accepts method="get" then you can.

If it accepts method="get" requests, then you can just link to the appropriate URL:
CODE
<a href="http://www.example.com/example.cgi?interest=$type&Products=Select+Category"><img src=... alt=...></a>
pandy
If "post" is required, couln't you use a hidden input instead of the radio button and either style the input button to look like a link or use INPUT type="image"?
Darin McGrew
Ah, yes. Good point. Just convert the radio button to a hidden field, and submit the form.
pulp25
QUOTE(Darin McGrew @ Feb 10 2007, 03:17 PM) *

Ah, yes. Good point. Just convert the radio button to a hidden field, and submit the form.



Thanks for the help!

I'm very new to all of this.

Would anyone happen to know a site that could help me out with the exact syntax with something like this?
Darin McGrew
Try the "HTML Reference" link at the bottom of this page...
pandy
The one at the top of the page ain't bad either! wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.