my knowledge is very "basic" about php and Js
So i made a research on the net,
I found out how to populate a simple input texte from a Combo box.
Now I need to populate a combo box, FROM another combo box.
But the information comes from a db.
So this is my first attempt (i'm still reading about it)
I don't need the whole code, just some help finding it on my own.
Here's my attempt (don't laugh)
Code: Select all
<body>
<div id="section">
<?php include ("includes/top_menu_en.html") ?>
<div>
<h1 id="titre">Skin Profile</h1>
</div>
<div id="texte"> blah blah blah yadda yadda blah blah blah blah blah blah blah blah blah blah blah blah
<br />
<br />
<form name="profil_en" method="post" action="$_SERVERї'PHP_SELF']">
<table width="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><select name="part" class="lignes" onchange="fill_conds()"><option value="--">--</option>
<?php
$part_sql = "SELECT * FROM prof_part";
$part_result = mysql_query($part_sql) or die(mysql_error());
$part_numrows = mysql_num_rows($part_result);
for ($i=0, $numrows=mysql_num_rows($part_result); $i<$numrows; $i++){
$row = mysql_fetch_row($part_result);
echo ("<option value="$rowї1]">$rowї1]</option>");
}
?>
</select></td></tr>
<tr>
<td><select name="cond" class="lignes"><option value=""></option>
<script language="JavaScript" type="text/javascript">
function fill_conds()
{
var fill=document.formsї0].part.optionsїdocument.formsї0].part.selectedIndex].value
<?php
$fill = fill;
$cond_sql = "SELECT * FROM prof_cond WHERE part_name = $fill";
$cond_result = mysql_query($cond_sql) or die(mysql_error());
$cond_numrows = mysql_num_rows($cond_result);
for ($i=0, $numrows=mysql_num_rows($cond_result); $i<$numrows; $i++){
$row = mysql_fetch_row($cond_result);
echo ("<option value="$rowї2]">$rowї2]</option>");
}
?>
}
</script>
</select></td>
</tr>
</table>
</form>
</div>
<?php include ("includes/small_menu_en.html") ?>
</div>
</body>I think that's it
If you need more info ask away
thx
PS : there is no more
Code: Select all
Tags?