Current location: Hot Scripts Forums » General Web Coding » HTML/XHTML/XML » kind of radiobutton


kind of radiobutton

Reply
  #1 (permalink)  
Old 06-12-09, 10:52 AM
jonnekke jonnekke is offline
Code Guru
 
Join Date: Oct 2005
Location: holland!
Posts: 704
Thanks: 0
Thanked 0 Times in 0 Posts
kind of radiobutton

Hi there...

I'm looking for a way to accomplish this...

in the backend of my site where the owner can add, edit or delete items
I want to make an opportunity to set the align of a background image.

I the attached image you see an example of how it should look.
The nine squares are buttons and should "select" the align type
I set as value as a radiobutton would do.

I could make a table with nine square cells en place a radiobutton in each
but that's not the way I like it to look.

The value that is set should be processed with php and stored in mysql.


Does anybody know how to get there?..

_j
Attached Images
File Type: png Afbeelding 26.png (5.8 KB, 87 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-12-09, 11:24 AM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Make a table with nine square cells and place an arrow image in each cell. Attach an onClick event to each image and process the input that way. You could do the same thing with one image and an image map, but ewwwwwww, that would be sleazy.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-12-09, 11:30 AM
jonnekke jonnekke is offline
Code Guru
 
Join Date: Oct 2005
Location: holland!
Posts: 704
Thanks: 0
Thanked 0 Times in 0 Posts
I want to make it 9 images...

but can it keep the value "in memory" tlll the form is submitted?
Or determine it on submit like a radio button?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 06-12-09, 12:32 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 Posts
When one of the images is being clicked, call a Javascript function (onclick) which saves the value of the clicked image in a hidden input field. Then it'll automatically submit when the form submits.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 06-13-09, 09:41 AM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by jonnekke View Post
I want to make it 9 images...
Like I said: "Make a table with nine square cells and place an arrow image in each cell."
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 06-13-09, 10:27 AM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
You could use an image map.

HTML map tag

HTML Code:
<img src="align_square.gif" width="81" height="81" alt="Alignment" usemap="#align_map" />
<map name="align_map">
<area shape="rect" coords="0,0,26,26" href="?align=tl" alt="topleft" />
<area shape="rect" coords="27,0,53,26" href="?align=tc" alt="topcenter" />
<area shape="rect" coords="54,0,82,26" href="?align=tr" alt="topright" />
...
</map>
You can also put an onclick on the area tags. HTML area tag

HTML Code:
<input type="hidden" id="alignment" value="default" />
...
<area shape="rect" coords="0,0,26,26" alt="topleft" nohref onclick="document.getElementById('alignment').value='topleft';" />
...
Untested, hope this helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Select radioButton, switch panel in C#/.net bscsGrad Windows .NET Programming 4 08-22-06 09:31 PM


All times are GMT -5. The time now is 07:27 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.