If I have pictures named pic1 , pic2 , pic3
how would I make them into buttons so that clicking on them wouldn't send you anywhere, but they would be registered as being clicked, so that once you hit submit you'd go to the next page and know which ones were and were not clicked on? Right now I have radio buttons to the right of each picture but I'd rather make it easier and just have the ability to click on the picture itself.
picture as a button
Moderator: General Moderators
-
jaymoore_299
- Forum Contributor
- Posts: 128
- Joined: Wed May 11, 2005 6:40 pm
- Contact:
I would create a js array and when the image is clicked, add the image id to the array, if it's unclicked strip it out of the array.
Then on your post, you can see which images were "selected" by looping through the array.
you could do something cool with the image too when it's clicked, like change the border, or make it step out a little bit to indicate that it was "selected".
Then on your post, you can see which images were "selected" by looping through the array.
you could do something cool with the image too when it's clicked, like change the border, or make it step out a little bit to indicate that it was "selected".
Yea i would do it like that too and it looks something like this from the top of my head:
If you want you can also add the javascript thingy so if someone hangs above your picture he sees the hand and knows it's clickable.
Hope this helps..
and hope i am right not to use PHP tags.. LOL
Code: Select all
<a href="javascript: document.form1.submit();" onClick="document.form1.action='index.php?yourdesiredvariables'"><img src="image_name"></a>Hope this helps..