Current location: Hot Scripts Forums » Programming Languages » PHP » How to replace radio button in a form with a picture?


How to replace radio button in a form with a picture?

Reply
  #1 (permalink)  
Old 11-06-05, 12:30 AM
amazing amazing is offline
New Member
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question How to replace radio button in a form with a picture?

My PHP script will show many radio buttons on the page which a client can choose and click then post it to other page. This script work well, but I prefer to use a picture rather radio buttons. When I change the radio button with a picture then I click on it then it post a wrong data, it always send the last data from MySQL table. Could anyone help??

<?PHP
echo "<FORM method='POST' action='file2.php'>
<table border='0' width='85%' cellpadding='0' style='text-align: center; border-collapse: collapse' id='table1'>";
$i = 1;
while ($row = mysql_fetch_assoc($queryresult))
{
extract($row);
if ($i == 1){echo "<tr>";}
echo "<td><input type='radio' name='radiobutton' value='$rowdata' size='20'";
echo "><input type='submit' value='$str'></td>";
$i++;
if ($i == 4){$i = 1; echo "</tr>";}
}
echo "</table></FORM>";
?>
Reply With Quote
  #2 (permalink)  
Old 11-06-05, 03:11 AM
liljoeyjordison liljoeyjordison is offline
Newbie Coder
 
Join Date: Jan 2005
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
If this can be done this will be a CSS question. Put id="radioButton" into your <input> tag. And then find the CSS code to make your tag an image.
Reply With Quote
  #3 (permalink)  
Old 11-17-05, 08:17 AM
amazing amazing is offline
New Member
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Hi liljoeyjordison

Hi liljoeyjordison,
I can't find the CSS code.
Could you give me the CSS code or examples of it or tell me where I can find it?
Thanks
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
Reset Button with picture Joebox99 HTML/XHTML/XML 4 06-14-05 08:57 AM
Validating form radio boxes on submit (edit my code) Cepeleon JavaScript 2 04-08-05 04:08 AM
checkCheckboxGroup broken after form consolidation ski_woman JavaScript 0 01-12-05 11:00 AM
Help needing for form action send and reset button mike78 HTML/XHTML/XML 2 01-04-05 02:26 PM
radio button selection TheLaughingBandit ASP 3 08-31-03 06:22 PM


All times are GMT -5. The time now is 06:18 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.