If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Needs help as i am trying to pull all recrods from the listbox

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-23-07, 22:56
mustish1 mustish1 is offline
Registered User
 
Join Date: Jul 2006
Posts: 149
Needs help as i am trying to pull all recrods from the listbox

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'>&nbsp&nbsp<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[i];
if (o.selected) {
frm.lstSSN.options[i] = 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[i].selected = true;
return true;
}

</script>
</body>




ASP

lstSSN = request.form( "lstSSN")
response.write(lstSSN)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On