HighDots Forums  

Image as radio button

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Image as radio button in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
James Shook
 
Posts: n/a

Default Image as radio button - 05-20-2004 , 05:14 PM






I'd like to use a custom image in a form that would function as a radio
button. I've found a script that will send a click from a graphic to the
radio button, but how can I do this without the real radio button being
visible?

--
James M. Shook
http://www.jshook.com

Reply With Quote
  #2  
Old   
Chris In Madison
 
Posts: n/a

Default Re: Image as radio button - 05-20-2004 , 05:29 PM






I use hidden fields to set values based on the radio button image selected.
Each radio button image has an onClick event that triggers the hidden field
value change and an image swap.

Best regards,
Chris



Reply With Quote
  #3  
Old   
James Shook
 
Posts: n/a

Default Re: Image as radio button - 05-20-2004 , 05:58 PM



Chris In Madison wrote:
Quote:
I use hidden fields to set values based on the radio button image selected.
Each radio button image has an onClick event that triggers the hidden field
value change and an image swap.
How do you hide the fields?

James M. Shook
http://www.jshook.com


Reply With Quote
  #4  
Old   
James Shook
 
Posts: n/a

Default Re: Image as radio button - 05-20-2004 , 06:07 PM



Never mind. Found a reference.

--
James M. Shook
http://www.jshook.com

Reply With Quote
  #5  
Old   
Kindler Chase
 
Posts: n/a

Default Re: Image as radio button - 05-20-2004 , 06:39 PM



James Shook wrote:
Quote:
I'd like to use a custom image in a form that would function as a
radio button. I've found a script that will send a click from a
graphic to the radio button, but how can I do this without the real
radio button being visible?
Something like this?

<script type="text/javascript">
function getValue(formName,fieldName,fieldValue) {
document[formName][fieldName].value = fieldValue
}
</script>
<form name="formName" id="formName" method="post" action="page.asp">
<a href="javascript:;"
onclick="getValue('formName','hiddenFieldName','va lue one');">
<img src="radio1.gif" height="16" width="16" alt="my radio button" /></a>
<a href="javascript:;"
onclick="getValue('formName','hiddenFieldName','va lue two');">
<img src="radio2.gif" height="16" width="16" alt="my radio button" /></a>
<input type="hidden" name="hiddenFieldName" id="hiddenFieldName" />
</form>


--
kindler chase
http://www.ncubed.com
Home of SuperInvoice's Fortress of Solitude

news://news.ncubed.com/support
n3 Support Group




Reply With Quote
  #6  
Old   
James Shook
 
Posts: n/a

Default Re: Image as radio button - 05-21-2004 , 09:41 AM



Kindler Chase wrote:

Quote:
Something like this? [...]
Thanks, but my client and I decided that this was a graphic refinement
that would not pay off in light of other considerations.

--
James M. Shook
http://www.jshook.com


Reply With Quote
  #7  
Old   
Chris In Madison
 
Posts: n/a

Default Re: Image as radio button - 05-21-2004 , 10:01 AM



<input type="hidden">

Regular ol' hidden form field. No biggie.

Best regards,
Chris



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.