Jump to content

button, drop down menu event handler


Klam

Recommended Posts

I am new to the php I want to know how to incoperate the php code (functions) with button or down dropmenu I want to know how to call those those event handler and activate the functions

Basically what I am doing is like this

Select the drop down menu and select the value and click ok and display the value on the text.
I also want to know how to blind the values from the database which is access into the drop down menu I am using a dreamweaver mx 2004
Link to comment
https://forums.phpfreaks.com/topic/28708-button-drop-down-menu-event-handler/
Share on other sites

For the first thing you can use javascript.

Second one, i couldn't understand completely what you intended to.I think you are tryign to display the databses values in select menu.
That you cna do like this...

<?php
[code]

$sq="select * from table_name";
$qry=mysql_query($sq) or die (mysql_error());

echo "<select name="test">
while($res=mysql_fetch_array($qry))
{
echo "<option value="$res['name']">$res['name']</option>";
}
echo "</select>";

?>
[/code]

If this is what you are looking for , then ok.Else exapnd your description little bit.

Regards,
Joshi.

Thats what I want thanks. But there was some mistake in that code
[code]
$sq="select * from table_name";
$qry=mysql_query($sq) or die (mysql_error());

echo '<select name="test">';
while($res=mysql_fetch_array($qry))
{
echo "<option value='.$res['name'].'>'.$res['name']'.</option>';
}
echo '</select>';
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.