473,320 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to get radio button value from the database

Hi all,

I have a 2 radio button . So i want to get the selected radio button value as it is stored in the data base .

here's the code :
Expand|Select|Wrap|Line Numbers
  1.  echo"<tr>
  2.                   <td >Availability : </td>
  3.                   <td><label>Yes<input class=\"inputbox\" type =\"radio\" name=\"availability2\" size=\"40\" value=if($availability=='yes') echo 'checked=\"checked\"';</label></td>
  4.                   var_dump($availability);
  5.                   <td><label>No<input class=\"inputbox\" type =\"radio\" name=\"availability2\" size=\"40\" value=if($availability=='no') echo 'checked=\"checked\"';</label></td>
  6.       </tr>";
  7.  
the result of var_dump($availability) is var_dump(no) , i don't know were's the mistake !!
thanks for reply
Jul 23 '12 #1
0 1441

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mokoena | last post by:
I can't seem to do an if statement check on the value returned from a selected radio button (isexistingleague). The code never runs anything within the if statement that tests if "true" is...
3
by: Flip | last post by:
In setting up a radio button group last night, I added two radio buttons, gave each of them their respective name and gave them both the same group name. So far so good. But then when I tried to...
4
by: yawnmoth | last post by:
I'm trying to display a popup showing which radio button is selected and am unable to do so. Every time I try, I get undefined, instead of the value of the particular form variable I'm trying to...
2
by: Matsam | last post by:
Hi, I have an ASP page that contains 3 radio buttons and a combo box. The combo box is to be populated depending on the option selected above. I am using Access DB. I want the value/checked...
4
by: Sonasang | last post by:
Hi , I am creating webpage in ASP. In that page i am using 2 radio button..... Male and female If onclick event fires for the radiobutton i have to update the value in the database as male (if...
1
by: selvialagar | last post by:
my code doesn't work. undefined is displayed.....how to get a value of radoi button in javascript function enableaddr() { alert(document.getElementById('reason').length); for (var i=0; i <...
5
Claus Mygind
by: Claus Mygind | last post by:
In my script I used to test the value of the radio button to verify which button was selected. I was able to do that because all the buttons have the same name. If I want to use the the proper...
9
by: ameshkin | last post by:
Hi guys, I'm a pretty good PHP programmer, but when it comes to JS, I just dont understand it! But I really need to learn. I'm having trouble doing the simplest thing! When someone clicks...
2
by: jen phoenix | last post by:
i have two radio buttons in my form named cash and check.. how do i code in the part of inserting into the database its checked value whether its cash or check?? please help..thanks..
1
by: lipton | last post by:
how can i compare a mysql table feild value with selected redio button value with php
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.