473,396 Members | 1,774 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,396 software developers and data experts.

how to catch a value from radio buttom getting its value from mysql?

Hi, this is a newbie question.

How can I catch the selected radio value from a form that is feed by the
mysql database?

EX.:
<input type="radio" name="myname" value="<?php $myvalue[3] ?>">

Value returns the last element of the array $myvalue[3]
instead of the selected value.

How can I change this?

Thanks in advance for any help,
Guillermina

Jul 17 '05 #1
4 4126
echo?

<input type="radio" name="myname" value="<?php echo $myvalue[3] ?>">

PWT

"gmanon" <gu*********@nyc.rr.com> wrote in message
news:3F**************@nyc.rr.com...
Hi, this is a newbie question.

How can I catch the selected radio value from a form that is feed by the
mysql database?

EX.:
<input type="radio" name="myname" value="<?php $myvalue[3] ?>">

Value returns the last element of the array $myvalue[3]
instead of the selected value.

How can I change this?

Thanks in advance for any help,
Guillermina

Jul 17 '05 #2
Yes, I'm using echo. May that be the problem? Should I use print or
printf instead?

Guillermina


Peter Taurins wrote:
echo?

<input type="radio" name="myname" value="<?php echo $myvalue[3] ?>">

PWT

"gmanon" <gu*********@nyc.rr.com> wrote in message
news:3F**************@nyc.rr.com...
Hi, this is a newbie question.

How can I catch the selected radio value from a form that is feed by the
mysql database?

EX.:
<input type="radio" name="myname" value="<?php $myvalue[3] ?>">

Value returns the last element of the array $myvalue[3]
instead of the selected value.

How can I change this?

Thanks in advance for any help,
Guillermina



Jul 17 '05 #3
With total disregard for any kind of safety measures gmanon
<gu*********@nyc.rr.com> leapt forth and uttered:
Yes, I'm using echo. May that be the problem? Should I use
print or printf instead?


He was pointing out that your first example doesn't output the
variable at all as you don't use echo or anything else.

--
There is no signature.....
Jul 17 '05 #4
Hi, Here a more detail script.

//VARIABLES FROM DATABASE RESULT
$row_array['city'] = $row_items[1];
$row_array['price'] = $row_items[3];
$row_array['description'] = $row_items[4];
$row_array['id'] = $row_items[5];

$id = $row_array[5];
$description = $row_array[4];
$price = $row_array[3];

//HTML CODE FOR RADIO BUTTON
if ($j == 1) { $radio = "<input type='radio' name='city' value='" .
$row_array[2] . "'>";}
else { $radio = "";}

//HIDDEN VALUES

<input type="hidden" name="tripNumber" value="<?php echo $id; ?>">
<input type="hidden" name="tripDescription" value="<?php echo
$description; ?>">
<input type="hidden" name="tripPrice" value="<?php echo $price; ?>">

//VARIABLES FOR OUTPUT

<td align="center" class="tableInside"><?php echo $tripNumber; ?></td>
<td align="center" class="tableInside"><?php echo $tripDescription; ?></td>
<td align="center" class="tableInside"><?php echo $noPassangers; </td>
<td align="center" class="tableInside"><?php printf("$%.2f",
$tripPrice); ?></td>
<td class="tableInside" align="right"><?php $subtotal = $tripPrice *
$noPassangers; printf("$%.2f", $subtotal); ?>&nbsp;&nbsp;</td>

Guillermina

Yes, I'm using echo. May that be the problem? Should I use
print or printf instead?

He was pointing out that your first example doesn't output the
variable at all as you don't use echo or anything else.


Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter | last post by:
Hi all, Sorry if this is an obvious/common question, but I'm trying to get the value of a radio button using JavaScript. Where I can easily get the value of a text field: ...
1
by: R.G. Vervoort | last post by:
I would like to make a script wich makes a select visible or not visible depending on what radio button is selected. If the radiobutton with the value "nieuw" is selected the pulldown is not...
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...
7
by: ravi | last post by:
Hi, I am a newbie to javascript. Iam working on a page that has two radio buttons and a tree. I do not have my tree nodes to be selectable. Iam working on Firefox. I have the firebug...
1
by: chris_huh | last post by:
I have a mysql database with a 'feeds' table in it allowing the use to add feeds to their site. What i also want is for them to be able to choose one to show on the homepage (or none), but only...
2
by: muymoy2001 | last post by:
I am using WebBrowser component where I display the web site. For example: The HTML source code which let the user choose a color: <input type="text" name="firstname" value="the name entered by...
3
by: kalyanibal | last post by:
can anybody help me out with my problem. in my submit form i have three radio buttons with the title "Mr,Mrs,Miss". how to select one radio button from the above three by using c# code behind....
4
by: Bernie | last post by:
Hello all, I am new to the group and new to javascripting, so I am hoping to find some good help here. Here is a snippet of my code: HTML: Name: <input type="text" name="ageName0"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.