Thanks! That worked super. However, now I want to get really cute and make this routine do some more work.
My members need to be able to change some skill information (text) and include associated search codes (numeric) which are directly related....but, the members only know the skills text and not the associate search code. The Administrator (me) has had to make those associations manually after the fact. Getting tired of that too!
I have modified the script to look more like I need the end result to be. A bit "hackky" but it almost works as needed.
Code follows:
Code:
<?
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Dropdown text box test Page</title>
<script type="text/javascript"><!--
function changeText1(obj) {
document.FormName1.skill1_code.value = obj.value;
}
//-->
</script>
<script type="text/javascript"><!--
function changeText2(obj) {
document.FormName2.skill2_code.value = obj.value;
}
//-->
</script>
</head>
<body bgcolor="#ffffff">
<?
$Askill1_text="database source text-1";
$Askill1_code="database source code-1";
$Askill2_text="database source text-2";
$Askill2_code="database source code-2";
?>
<form id="FormName1" method="get" name="FormName1">
Skill 1 Code:<input type="text" maxlength="35" size="35" name="skill1_code" value="<? echo
"$Askill1_code"?>"><select name="selectName" size="1" onchange="changeText1(this);">
<option>Choose one Skill..</option>
<option value="1">Accounting</option>
<option value="2">Sales Management</option>
<option value="3">Human Resources</option>
</select></br>
Skill 1 Text : <input type="text" maxlength="2" size="25" name="skill1_text" value="<? echo
"$Askill1_text"?>"></br>
</form>
<form id="FormName2" method="get" name="FormName2">
Skill 2 Code:<input type="text" maxlength="35" size="35" name="skill2_code" value="<? echo
"$Askill2_code"?>"><select name="selectName" size="1" onchange="changeText2(this);">
<option>Choose one Skill..</option>
<option value="1">Accounting</option>
<option value="2">Sales Management</option>
<option value="3">Human Resources</option>
</select></br>
Skill 2 Text : <input type="text" maxlength="2" size="25" name="skill2_text" value="<? echo
"$Askill2_text"?>"></br>
</form>
<p></p>
</body>
</html>
<?
The php tags are just to make sure it works when I include it in my current php script.
This results in a numeric code where I want it but I also need the associated text to be in the "correct" text box. Can I create a "two" value drop down list...one value for the code and another for the associated text? Or, is there a way to get the dropdown text, as shown, into the associated text box?
It would really make my job easier if there is a way to acomplish this task.
Frodocyber
|