I have run into a problem this code does work but instead of displaying what shows up in the dropdown box its shows the catergories ID number in the title field.
It gets this ID number from the database.
Thanks
I have been told that I could use JScript to do a lookup of the ID number and change it to its name.
Is there anyone who can show me how
Please.
In the drop down box it shows a list of names from a database when someone selects a name I want that name to go into the title field,but instead of the name going in the tilte field the ID number for that name goes in...
This code wasnt mine to start off with so any help would be great...
<form name="add" action="addlink.asp" method="post" onsubmit="return validate(this)">
<select name="category" onChange="javascriptopulateTitle()">
<script language="javascript">
function populateTitle() {
var listBox = document.forms["add"].elements["category"];
var titleText = document.forms["add"].elements["title"];
for(i=0; i<listBox.options.length; i++) {
if (listBox.options.selected) {
titleText.value = listBox.options.value;
}
}
}
</script>
<input size="50" name="title" value="">
It gets this ID number from the database.
Thanks
I have been told that I could use JScript to do a lookup of the ID number and change it to its name.
Is there anyone who can show me how
Please.
In the drop down box it shows a list of names from a database when someone selects a name I want that name to go into the title field,but instead of the name going in the tilte field the ID number for that name goes in...
This code wasnt mine to start off with so any help would be great...
<form name="add" action="addlink.asp" method="post" onsubmit="return validate(this)">
<select name="category" onChange="javascriptopulateTitle()">
<script language="javascript">
function populateTitle() {
var listBox = document.forms["add"].elements["category"];
var titleText = document.forms["add"].elements["title"];
for(i=0; i<listBox.options.length; i++) {
if (listBox.options.selected) {
titleText.value = listBox.options.value;
}
}
}
</script>
<input size="50" name="title" value="">