I'm using PHP and MySQL. To make this question easier to
explain..... I have 3 radio buttons in a group with a values 1 - 3.
In the database I have a table consisting of the primary key field
and an ordinary field, say, ''animal''. So its like this:
Primary Key field Animal
1 Dog
2 Cat
3 Mouse
What I'd like to be able to do on the webpage is to select a
radio button and the corresponding animal name shows up on the same
page. I know how to do this over two pages where you have a $_POST,
but how can I make it so that the ID of the animal is retrieved
once a radio button is selected on the SAME page. I'm sure its
pretty simple but I can't figure it out, I've tried to use ''Form
variables'' and the others.
Thanks very much.Radio button help
well, that page would actually have to reload *and* use a
query to retrieve the respective animal麓s ID -- maybe this
might work with some AJAX functionality that麓s loading the
result in a certain area of the page without reloading it all, but
with regular HTML you can麓t achieve this on one pageRadio button help
geschenk wrote:
%26gt; well, that page would actually have to reload *and* use
a query to retrieve the
%26gt; respective animal麓s ID -- maybe this might work
with some AJAX functionality
%26gt; that麓s loading the result in a certain area of the
page without reloading it
%26gt; all, but with regular HTML you can麓t achieve this
on one page
%26gt;
Hi
I don't do PHP, however you would do this by using a
conditional
statement around the code that returns the animal, set this
conditional
statement to run only when the form is submitted and set the
same
conditional logic around the code that shows the animal
selected in the
body of your page.
--
Cheers jojo
Adobe Community Expert for Dreamweaver 8
----------------------------------------------------
http://www.webade.co.uk
http://www.ukcsstraining.co.uk/
----------------------------------------------------
Extending Knowledge, Daily.
http://www.communityMX.com/
Free 10 day trial
http://www.communitymx.com/joincmx.cfm
----------------------------------------------------
Subscribe to:
Post Comments
(Atom)
No comments:
Post a Comment