|
 |
asp_web_howto thread: Large select box
Message #1 by "John Miller" <jpmiller@a...> on Thu, 7 Mar 2002 15:17:57
|
|
I have a section in my app where users can enter notes, then later select
a note they have entered and delete or edit it. The problem is that the
select box I put the note into can get huge. Is there a way to keep the
drop down type of select box, but wrap the text?
Code for page 1:
<form name=Form1 method="post" action="DeleteNotes2.asp">
<hr>
<table border="0" width="100%" cellpadding="2">
<tr>
<td width="100%" valign="bottom" align="left"><b>Notes:</b></td>
</tr>
<tr>
<td width="100%" valign="bottom" align="left"><select name="Notes">
<% If rsNote1.EOF or rsNote1.BOF then %>
<option> Nothing to delete. </option>
<% Else %>
<% Do While not rsNote1.EOF %>
<option> <%= rsNote1(1) %> </option>
<% rsNote1.MoveNext
Loop %></select></td>
<% End If %>
</tr>
</table>
<table border="0" width="60%" align="center" cellpadding="0">
<tr>
<td width="30%" align="right" valign="top"><input type="submit"
name="B1" value="Delete"></form></td>
<td width="30%" align="left" valign="top"><form name=form2
method="POST" action="ChooseNotes.asp">
<input type="submit" name="B2"
value="Finished"></form></td>
</tr>
</table>
<hr>
<table border="0" width="100%" cellpadding="2">
<tr>
<td bgcolor="#aaaaff" valign="bottom"
align="left"><b>Date:</b></td>
<td bgcolor="#aaaaff" valign="bottom"
align="left"><b>Notes:</b></td>
</tr>
<% Do while not rsNote2.EOF %>
<% Note = rsNote2(1) %>
<% Note = replace(Note, " | ", "<BR>") %>
<tr>
<td bgcolor="#F7EFDE" valign="top" align="left"><%= rsNote2(2)%
></td>
<td bgcolor="#F7EFDE" valign="top" align="left"><%= Note %></td>
</tr>
<% rsNote2.moveNext
loop %>
</table>
Code for Page 2:
<% response.buffer=true %>
<% SSN = session("ssn") %>
<% Notes = request("Notes") %>
<% Notes = replace(Notes, "'", "''") %>
<% Notes = replace(Notes, vbCrLf, " | ") %>
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\wib\wib.mdb"
SQLKill = "Delete * From [ISS_Notes] Where SSN = " & ssn & " and Notes = '"
SQLKill = SQLKill & Notes & "'"
Conn.Execute(SQLKill)
Conn.Close
Set Conn = Nothing
%>
<% response.redirect "DeleteNotes1.asp" %>
Thanx
John Miller
Message #2 by Oleg Kapeljushnik <c-oleg.kapeljushnik@w...> on Thu, 07 Mar 2002 10:23:41 -0500
|
|
Why don't you present only first few characters from the note.
You can do something like :
<option> <%= Left(rsNote1(1),50) %> </option>
Then you know that only first 50 character will be present.
And then you also can give them an option to see full note description in
some other window
or textarea place.
Oleg.
-----Original Message-----
From: John Miller [mailto:jpmiller@a...]
Sent: March 07, 2002 10:18 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Large select box
I have a section in my app where users can enter notes, then later select
a note they have entered and delete or edit it. The problem is that the
select box I put the note into can get huge. Is there a way to keep the
drop down type of select box, but wrap the text?
Code for page 1:
<form name=Form1 method="post" action="DeleteNotes2.asp">
<hr>
<table border="0" width="100%" cellpadding="2">
<tr>
<td width="100%" valign="bottom" align="left"><b>Notes:</b></td>
</tr>
<tr>
<td width="100%" valign="bottom" align="left"><select name="Notes">
<% If rsNote1.EOF or rsNote1.BOF then %>
<option> Nothing to delete. </option>
<% Else %>
<% Do While not rsNote1.EOF %>
<option> <%= rsNote1(1) %> </option>
<% rsNote1.MoveNext
Loop %></select></td>
<% End If %>
</tr>
</table>
<table border="0" width="60%" align="center" cellpadding="0">
<tr>
<td width="30%" align="right" valign="top"><input type="submit"
name="B1" value="Delete"></form></td>
<td width="30%" align="left" valign="top"><form name=form2
method="POST" action="ChooseNotes.asp">
<input type="submit" name="B2"
value="Finished"></form></td>
</tr>
</table>
<hr>
<table border="0" width="100%" cellpadding="2">
<tr>
<td bgcolor="#aaaaff" valign="bottom"
align="left"><b>Date:</b></td>
<td bgcolor="#aaaaff" valign="bottom"
align="left"><b>Notes:</b></td>
</tr>
<% Do while not rsNote2.EOF %>
<% Note = rsNote2(1) %>
<% Note = replace(Note, " | ", "<BR>") %>
<tr>
<td bgcolor="#F7EFDE" valign="top" align="left"><%= rsNote2(2)%
></td>
<td bgcolor="#F7EFDE" valign="top" align="left"><%= Note %></td>
</tr>
<% rsNote2.moveNext
loop %>
</table>
Code for Page 2:
<% response.buffer=true %>
<% SSN = session("ssn") %>
<% Notes = request("Notes") %>
<% Notes = replace(Notes, "'", "''") %>
<% Notes = replace(Notes, vbCrLf, " | ") %>
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\wib\wib.mdb"
SQLKill = "Delete * From [ISS_Notes] Where SSN = " & ssn & " and Notes = '"
SQLKill = SQLKill & Notes & "'"
Conn.Execute(SQLKill)
Conn.Close
Set Conn = Nothing
%>
<% response.redirect "DeleteNotes1.asp" %>
Thanx
John Miller
$subst('Email.Unsub').
|
|
 |