can't get the value from the first combobox. how should I do
Posted: Wed Aug 15, 2007 10:15 pm
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hi
I have a problem with my php. I have 2 combo box, the first combobox i fill with table name from database and the second combobox i want to fill it with field from table that i picked from first combobox. the problem is i can't get the value from the first combobox. how should I do?? javascript is needed,isn't it?
here is my code:Code: Select all
<?
require "Plugins/config.inc.php";
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<title>無標題文件</title>
<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<?
$DBname=$_GET['DBname'];
?>
<table width="766" height="245" border="0">
<form id="form1" name="form1" method="post" action="updateDB.php">
<tr>
<td width="65" height="42">Table:</td>
<td width="20">
<input name="table" type="radio" value="1" /> </td>
<td width="144"><select name="menu2" onChange="MM_jumpMenu('parent',this,0)">
<?
$str="show tables from $DBname";
$query=mysql_query($str) or die(mysql_error());
while(list($table)=mysql_fetch_row($query))
{
echo "<option value="InsertData.php?DBname=$DBname">$table</option>";
}
?>
</select></td>
<td width="22">
<input name="table" type="radio" value="2" /> </td>
<td width="157">
<input type="text" name="tablename" /> </td>
<td colspan="2">
<input name="table" type="radio" value="3" />
ALL </td>
<td colspan="2"> </td>
</tr>
<tr>
<td height="40">Field:</td>
<td> </td>
<td><select name="menu3" onChange="MM_jumpMenu('In',this,0)">
<option>未命名1</option>
</select></td>
<td> </td>
<td><input type="text" name="textfield2" /></td>
<td colspan="2">
<input type="text" name="textfield3" /> </td>
<td colspan="2"></td>
</tr>
<tr>
<td>Action:</td>
<td>
<input name="radiobutton" type="radio" value="radiobutton" /> </td>
<td>Clear</td>
<td>
<input name="radiobutton" type="radio" value="radiobutton" /> </td>
<td>Delete</td>
<td width="25">
<input name="radiobutton" type="radio" value="radiobutton" /> </td>
<td width="129">Update</td>
<td width="22">
<input name="radiobutton" type="radio" value="radiobutton" /> </td>
<td width="144">Insert</td>
</tr>
<tr>
<td>Value:</td>
<td>
<input name="radiobutton" type="radio" value="radiobutton" /> </td>
<td>
<input type="text" name="textfield4" /> </td>
<td>
<input name="radiobutton" type="radio" value="radiobutton" /> </td>
<td>NewID</td>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="9">
<input type="submit" name="Submit" value="送出" />
</form>
</table>
</body>
</html>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
[quote="[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1"][b]2.[/b] Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.[/quote]