I have a form where a listbox will load a list of names (lastname, firstname) and when the user select a name and click " >> " button it will display into a textbox,
but as the names display into the textbox, it will just display the lastname instead of fullname (lastname, firstname). eg. (abraham collins when it display into the textbox it will display abraham without the collins). may i know how to include the whitespaces into the texbox? ive already tried to use some solutions that was posted on the internet but still it didnt work.
php file:
echo '<select name="employee_name" id="employee_name" mulitple="multiple">';
if ($reader >=1){
while($row= mssql_fetch_array($result)){
echo "<option value=".$row["FullName"].">".$row['FullName']."</option>";
}
}
echo '</select>';
echo '</td>';
echo '<td>';
echo '<u">';
echo '<li><input type = "button" name = "btnNext" id= "btnNext" onClick = "AddList();" value = ">>" ></li>';
echo '<li><input type = "button" name = "btnPrev" id = "btnPrev" onClick = "RemoveList();" value = "<<"></li>';
echo '</ul>';
echo '</td>';
Javascript:
function AddList(){
var sel=document.getElementById('employee_name').value;
document.getElementById('approver_name').value = sel;
}