C
colleen1980
Hi: I am trying to pull all the values from the listbox. But the ASP
code shows only the last record. Needs help
HTML
<html>
<head>
<body>
<h2><center>DECEASED DATA SEARCH</center></h2>
<br><br>
<table border='0' align='center'>
<form name='deceasedsocial' id='deceasedsocial' method='POST'
onsubmit="return selectAllOptions()">
<tr>
<td>Enter Social Security Number</td><td><input type='text' name='ssn'
id='ssn'>  <select id="lstSSN" name="lstSSN"></select></td></
tr>
<tr><td><input type="button" value="Add" onclick="return
loadList();"></select>
<input type="button" value="Delete" onclick="return deleteIt();"></
select>
<input type="submit" value="Process"
onClick="this.form.action='ProcessDeceased.asp'";>
</td></tr>
<tr><td><input type="submit" value="Todays Deceased"
onClick="this.form.action='hello.asp'";>
</td></tr>
</table>
</form>
<script language="JavaScript">
var frm = document["deceasedsocial"];
function loadList() {
intCount = frm.lstSSN.length;
frm.lstSSN.options[intCount] = new
Option(frm.ssn.value,frm.ssn.value);
// Get textbox, clear it then focus onto it.
var textbox = document.getElementById('ssn');
textbox.text = "";
textbox.focus();
document.getElementById('ssn').value=""
document.getElementById('ssn').focus();
return true;
}
function deleteIt()
{
for (var i=(frm.lstSSN.options.length-1); i>=0; i--)
{
var o=frm.lstSSN.options;
if (o.selected) {
frm.lstSSN.options = null;
document.getElementById('ssn').focus();
return true;
}
}
return true;
}
function selectAllOptions() {
var ref = document.getElementById('lstSSN');
for(i=0; i<ref.options.length; i++)
ref.options.selected = true;
return true;
}
</script>
</body>
ASP
lstSSN = request.form( "lstSSN")
response.write(lstSSN)
code shows only the last record. Needs help
HTML
<html>
<head>
<body>
<h2><center>DECEASED DATA SEARCH</center></h2>
<br><br>
<table border='0' align='center'>
<form name='deceasedsocial' id='deceasedsocial' method='POST'
onsubmit="return selectAllOptions()">
<tr>
<td>Enter Social Security Number</td><td><input type='text' name='ssn'
id='ssn'>  <select id="lstSSN" name="lstSSN"></select></td></
tr>
<tr><td><input type="button" value="Add" onclick="return
loadList();"></select>
<input type="button" value="Delete" onclick="return deleteIt();"></
select>
<input type="submit" value="Process"
onClick="this.form.action='ProcessDeceased.asp'";>
</td></tr>
<tr><td><input type="submit" value="Todays Deceased"
onClick="this.form.action='hello.asp'";>
</td></tr>
</table>
</form>
<script language="JavaScript">
var frm = document["deceasedsocial"];
function loadList() {
intCount = frm.lstSSN.length;
frm.lstSSN.options[intCount] = new
Option(frm.ssn.value,frm.ssn.value);
// Get textbox, clear it then focus onto it.
var textbox = document.getElementById('ssn');
textbox.text = "";
textbox.focus();
document.getElementById('ssn').value=""
document.getElementById('ssn').focus();
return true;
}
function deleteIt()
{
for (var i=(frm.lstSSN.options.length-1); i>=0; i--)
{
var o=frm.lstSSN.options;
if (o.selected) {
frm.lstSSN.options = null;
document.getElementById('ssn').focus();
return true;
}
}
return true;
}
function selectAllOptions() {
var ref = document.getElementById('lstSSN');
for(i=0; i<ref.options.length; i++)
ref.options.selected = true;
return true;
}
</script>
</body>
ASP
lstSSN = request.form( "lstSSN")
response.write(lstSSN)