Who can write a 2-level linkage Select example to see
Write a simple example and write a comment. Thank you, prawn.
------Solution--------------------
function College2subject (Collegeid)
{
var allcount=0;
Subjectarray=new Array ();
$link =mysql_connect ("localhost", "root", "123");
$db _selected=mysql_select_db ("test");
mysql_query ("SET NAMES UTF8");
$sql = "SELECT * from subject";
$result =mysql_query ($sql);
$count = 0;
while ($myrow =mysql_fetch_array ($result))
{
echo "subjectarray[". $count. "] =new Array (' ". $myrow [' subject_id ']." ', ' ". $myrow [' Subject_name ']." ',
'. $myrow [' college_id ']. "') \ n ";
$count + +;
}
echo "allcount= $count;";
?>
document.studentform.subject.length=0;
Document.studentform.subject.options[document.studentform.subject.length]=new Option ("All Professions", "");
var College_id=collegeid;
var i;
for (i=0;i{
if (subjectarray[i][2]==college_id)
{
Document.studentform.subject.options[document.studentform.subject.length]=new Opiton (SubjectArray[i][1], Subjectarray[i][0]);
Alert ("OK");
}
}
}
Alert ("OK");
$link =mysql_connect ("localhost", "root", "123");
$db _selected=mysql_select_db ("test");
mysql_query ("SET NAMES UTF8");
$sql = "SELECT * from college";
$result =mysql_query ($sql) or Die (Mysql_error ());
?>
Please select Academy |
all colleges !--? php while ($myrow 1=mysql_fetch_array ($result)) {? & Gt " selected= "selected" > "!--? php echo $myrow 1[" College_name "] ;? --> !--? php}?-->------solution--------------------Select filter _water plate Please select water1 water2 water3 water4 water5 Two-level tile Please select water5-5 water5-6 |