Snappy2873
Programmer
How do I lock a table into staying one size horizontally?
Here is my code for the search page that works properly. THe problem is that when I search in the "keyword" column the search results explode horizontally outside my limits I've set in the table specs. I just want the results to wrap vertically.
Here is my code:
<!--#INCLUDE FILE="include/functions_inc.asp"-->
<HTML>
<HEAD>
<%
searchtext = Request.Form("searchtext")
searchfield = Request.Form("searchfield")
IF searchtext = "" Then%>
<TITLE>TechLibrary V3.0</TITLE>
<%ELSE%>
<TITLE>TechLibrary V3.0 Search Results for <%=searchtext%></TITLE><%
END IF%>
<script>
//JSCRIPT
function ChangeButton(what)
{
if(what.className == ""){
what.className = "mouseover"
}else{
what.className = ""
}
}
function CheckFields()
{
if(document.frmsearch.searchfield.value==""){
alert("Please select a Category!")
document.frmsearch.searchfield.focus();
}else{
if(document.frmsearch.searchtext.value==""){
alert("Please enter some search criteria!")
document.frmsearch.searchtext.focus();
}else{
document.frmsearch.method="post"
document.frmsearch.action="docsearch.asp"
document.frmsearch.submit();
}
}
}
</script>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
function window_onload()
{
document.frmsearch.searchfield.focus();
}
</SCRIPT>
</HEAD>
<BODY LANGUAGE=javascript onload="return window_onload()">
<FORM ACTION="" METHOD="post" NAME="frmsearch" onSubmit="return false">
<BR>
<%IF searchtext = "" THEN%>
<TABLE>
<TR>
<TD class="_header_">TechLibrary V3.0 Document Search</TD>
</TR>
<TR>
<TD> </TD>
</TR>
</table>
<TABLE>
<TR>
<TD>Category field:<select name="searchfield">
<option value="">
Please select one of the following
<option value="docident">Document Identifier
<option value="doctitle">Document Title
<option value="dockeyword">Keywords
<option value="docloc">Location
<option value="docauthor">Author
</select></TD>
</tr>
<tr>
<TD>Text to search for:<INPUT NAME="searchtext" SIZE=30 MAXLENGTH=64></TD>
</TR>
<TR>
<TD><INPUT TYPE="submit" VALUE="SEARCH" ONMOUSEOVER="ChangeButton(this);" onmouseout="ChangeButton(this);" onclick="CheckFields();" id=submit1 name=submit1> <INPUT TYPE="reset" VALUE="RESET" ONMOUSEOVER="ChangeButton(this);" onmouseout="ChangeButton(this);" id=reset1 name=reset1></div></TD>
</TR>
</TABLE>
<%ELSE%>
<TABLE>
<TR>
<TD class="header">TechLibrary V3.0 Search Results</TD>
</TR>
<TR>
<TD> </TD>
</TR>
</table>
<%
jiggy1 = "SELECT * FROM [tblDocument] "
select case searchfield
case "'docident'"
jiggy2 = "WHERE " & searchfield & " = " & searchtext & " "
case "'doctitle'"
jiggy2 = "WHERE " & searchfield & " = " & searchtext & " "
case "'dockeyword'"
jiggy2 = "WHERE " & searchfield & " = " & searchtext & " "
case "'docloc'"
jiggy2 = "WHERE " & searchfield & " = " & searchtext & " "
case "'docauthor'"
jiggy2 = "WHERE " & searchfield & " = " & searchtext & " "
case else
jiggy2 = "WHERE " & searchfield & " like '%" & searchtext & "%' "
end select
jiggy3 = "ORDER BY docident, doctitle, dockeyword, docloc, docauthor"
stmt = jiggy1 & jiggy2 & jiggy3
call ConnectDB()
Set objRS = objConn.Execute(stmt, , adCmdText)
if not objRS is nothing then
if not objRS.bof and not objRS.eof then
%>
<TABLE width="55%" align="center" cellpadding=2 cellspacing-2 border=1>
<TR>
<TD class="detailsdark">Document Identifier</TD>
<TD class="detailsdark">Title</TD>
<TD class="detailsdark">Keywords</TD>
<TD class="detailsdark">Location</TD>
<TD class="detailsdark">Author</TD>
</TR>
<%do until objRS.EOF%>
<TR>
<TD class="detailslightleft" COLSPAN=1>
<%= objRS.Fields("docident")%>
</TD>
<TD class="detailslightleft" COLSPAN=1>
<%= objRS.Fields("doctitle")%>
</TD>
<TD class="detailslightleft" COLSPAN=1>
<%= objRS.Fields("dockeyword")%>
</TD>
<TD class="detailslight" COLSPAN=1>
<%= objRS.Fields("docloc")%>
</TD>
<TD class="detailslight" COLSPAN=1>
<%= objRS.Fields("docauthor")%>
</TD>
<TD class="detailslight">
<A HREF="return false" onmousedown="javascript:OpenWindow('iamges/docentry.asp')">View Doc entry</A>
</TD>
<TD class="detailslight">
<A HREF="return false" onmousedown="javascript:OpenWindow('images/docentry.asp')">Edit Doc entry</A>
</TD>
<%objRS.Movenext%>
</TR>
<%lOOP%>
</TABLE><%
objRS.CLose
Set objRS = Nothing
else%>
<TABLE>
<TR>
<TD class="detailsdark">Nothing Found!</TD>
</TR>
</table>
<%end if
else%>
<TABLE>
<TR>
<TD class="detailsdark">Nothing Found!</TD>
</TR>
</table><%
end if
call DisConnectDB()
END IF%>
<!--#INCLUDE FILE="include/MenuOptions_inc.asp"-->
<!--#INCLUDE FILE="navigate.asp"-->
</BODY>
</HTML>
Here is my code for the search page that works properly. THe problem is that when I search in the "keyword" column the search results explode horizontally outside my limits I've set in the table specs. I just want the results to wrap vertically.
Here is my code:
<!--#INCLUDE FILE="include/functions_inc.asp"-->
<HTML>
<HEAD>
<%
searchtext = Request.Form("searchtext")
searchfield = Request.Form("searchfield")
IF searchtext = "" Then%>
<TITLE>TechLibrary V3.0</TITLE>
<%ELSE%>
<TITLE>TechLibrary V3.0 Search Results for <%=searchtext%></TITLE><%
END IF%>
<script>
//JSCRIPT
function ChangeButton(what)
{
if(what.className == ""){
what.className = "mouseover"
}else{
what.className = ""
}
}
function CheckFields()
{
if(document.frmsearch.searchfield.value==""){
alert("Please select a Category!")
document.frmsearch.searchfield.focus();
}else{
if(document.frmsearch.searchtext.value==""){
alert("Please enter some search criteria!")
document.frmsearch.searchtext.focus();
}else{
document.frmsearch.method="post"
document.frmsearch.action="docsearch.asp"
document.frmsearch.submit();
}
}
}
</script>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
function window_onload()
{
document.frmsearch.searchfield.focus();
}
</SCRIPT>
</HEAD>
<BODY LANGUAGE=javascript onload="return window_onload()">
<FORM ACTION="" METHOD="post" NAME="frmsearch" onSubmit="return false">
<BR>
<%IF searchtext = "" THEN%>
<TABLE>
<TR>
<TD class="_header_">TechLibrary V3.0 Document Search</TD>
</TR>
<TR>
<TD> </TD>
</TR>
</table>
<TABLE>
<TR>
<TD>Category field:<select name="searchfield">
<option value="">
Please select one of the following
<option value="docident">Document Identifier
<option value="doctitle">Document Title
<option value="dockeyword">Keywords
<option value="docloc">Location
<option value="docauthor">Author
</select></TD>
</tr>
<tr>
<TD>Text to search for:<INPUT NAME="searchtext" SIZE=30 MAXLENGTH=64></TD>
</TR>
<TR>
<TD><INPUT TYPE="submit" VALUE="SEARCH" ONMOUSEOVER="ChangeButton(this);" onmouseout="ChangeButton(this);" onclick="CheckFields();" id=submit1 name=submit1> <INPUT TYPE="reset" VALUE="RESET" ONMOUSEOVER="ChangeButton(this);" onmouseout="ChangeButton(this);" id=reset1 name=reset1></div></TD>
</TR>
</TABLE>
<%ELSE%>
<TABLE>
<TR>
<TD class="header">TechLibrary V3.0 Search Results</TD>
</TR>
<TR>
<TD> </TD>
</TR>
</table>
<%
jiggy1 = "SELECT * FROM [tblDocument] "
select case searchfield
case "'docident'"
jiggy2 = "WHERE " & searchfield & " = " & searchtext & " "
case "'doctitle'"
jiggy2 = "WHERE " & searchfield & " = " & searchtext & " "
case "'dockeyword'"
jiggy2 = "WHERE " & searchfield & " = " & searchtext & " "
case "'docloc'"
jiggy2 = "WHERE " & searchfield & " = " & searchtext & " "
case "'docauthor'"
jiggy2 = "WHERE " & searchfield & " = " & searchtext & " "
case else
jiggy2 = "WHERE " & searchfield & " like '%" & searchtext & "%' "
end select
jiggy3 = "ORDER BY docident, doctitle, dockeyword, docloc, docauthor"
stmt = jiggy1 & jiggy2 & jiggy3
call ConnectDB()
Set objRS = objConn.Execute(stmt, , adCmdText)
if not objRS is nothing then
if not objRS.bof and not objRS.eof then
%>
<TABLE width="55%" align="center" cellpadding=2 cellspacing-2 border=1>
<TR>
<TD class="detailsdark">Document Identifier</TD>
<TD class="detailsdark">Title</TD>
<TD class="detailsdark">Keywords</TD>
<TD class="detailsdark">Location</TD>
<TD class="detailsdark">Author</TD>
</TR>
<%do until objRS.EOF%>
<TR>
<TD class="detailslightleft" COLSPAN=1>
<%= objRS.Fields("docident")%>
</TD>
<TD class="detailslightleft" COLSPAN=1>
<%= objRS.Fields("doctitle")%>
</TD>
<TD class="detailslightleft" COLSPAN=1>
<%= objRS.Fields("dockeyword")%>
</TD>
<TD class="detailslight" COLSPAN=1>
<%= objRS.Fields("docloc")%>
</TD>
<TD class="detailslight" COLSPAN=1>
<%= objRS.Fields("docauthor")%>
</TD>
<TD class="detailslight">
<A HREF="return false" onmousedown="javascript:OpenWindow('iamges/docentry.asp')">View Doc entry</A>
</TD>
<TD class="detailslight">
<A HREF="return false" onmousedown="javascript:OpenWindow('images/docentry.asp')">Edit Doc entry</A>
</TD>
<%objRS.Movenext%>
</TR>
<%lOOP%>
</TABLE><%
objRS.CLose
Set objRS = Nothing
else%>
<TABLE>
<TR>
<TD class="detailsdark">Nothing Found!</TD>
</TR>
</table>
<%end if
else%>
<TABLE>
<TR>
<TD class="detailsdark">Nothing Found!</TD>
</TR>
</table><%
end if
call DisConnectDB()
END IF%>
<!--#INCLUDE FILE="include/MenuOptions_inc.asp"-->
<!--#INCLUDE FILE="navigate.asp"-->
</BODY>
</HTML>