By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,156 Members | 1,071 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,156 IT Pros & Developers. It's quick & easy.

Simple Page Search

P: n/a
We have a simple html page that contains a long list of documents that users
can hyperlink to. The entries are currently in alphabetical order and we
would like to implement some type of page search instead of requiring users
to go to Edit, Find, and type in the search. I am very new to ASP but
suspect that this is possible. We would simply like to have a SEARCH box at
the top of the page and it allows users to search only the current page for
words. We simply want something a little more eloquent than the built in IE
page search. Any ideas are appreciated.

Thanks,
Fred
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
You want them to be able to search on a page that has already loaded on the
client? Then you want JavaScript, not ASP. ASP no longer exists once the
page is rendered on the client, so can't be a vehicle for client-side
activity.

If you store the document links in a database, you could search against a
database, but this is no more convenient than edit/find because you have to
go back to the server for that.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Fred Yarbrough" <fc*********@yahoo.com> wrote in message
news:#$**************@TK2MSFTNGP12.phx.gbl...
We have a simple html page that contains a long list of documents that users can hyperlink to. The entries are currently in alphabetical order and we
would like to implement some type of page search instead of requiring users to go to Edit, Find, and type in the search. I am very new to ASP but
suspect that this is possible. We would simply like to have a SEARCH box at the top of the page and it allows users to search only the current page for words. We simply want something a little more eloquent than the built in IE page search. Any ideas are appreciated.

Thanks,
Fred

Jul 19 '05 #2

P: n/a
Aaron,
I thought that this could be saved as an ASP page and then scripted to
check upon submission of the Search button to see if the option was
populated. If so then it would return some filtered result set of links.
If they did not search then they would simply see all of the links and could
pick one.

I will look into the JavaScript option. I am really clueless with the
Java stuff but I will see what is out there.

Thanks Aaron,!

Fred


"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
You want them to be able to search on a page that has already loaded on the client? Then you want JavaScript, not ASP. ASP no longer exists once the
page is rendered on the client, so can't be a vehicle for client-side
activity.

If you store the document links in a database, you could search against a
database, but this is no more convenient than edit/find because you have to go back to the server for that.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Fred Yarbrough" <fc*********@yahoo.com> wrote in message
news:#$**************@TK2MSFTNGP12.phx.gbl...
We have a simple html page that contains a long list of documents that users
can hyperlink to. The entries are currently in alphabetical order and we would like to implement some type of page search instead of requiring

users
to go to Edit, Find, and type in the search. I am very new to ASP but
suspect that this is possible. We would simply like to have a SEARCH

box at
the top of the page and it allows users to search only the current page for
words. We simply want something a little more eloquent than the built

in IE
page search. Any ideas are appreciated.

Thanks,
Fred


Jul 19 '05 #3

P: n/a
You could use ASP code like this below, where you create the table entries
based on an array of data, filtered by the user's search parameters. In
this case, the page starts showing all entries. If the user entires
something like "F" to search, only those entries with an "F" are displayed.
-rwg

<%
dim Words, Links, Idx, SearchAction

Words = array( "First Listing", "Second Listing", "Third not First " )
Links = array( "www.microsoft.com", "support.microsoft.com",
"msdn.microsoft.com" )
SearchAction = Request.form( "SearchData" )
if SearchAction <> "" then
SearchAction = trim( SearchAction )
end if

%>
<HTML>
<Form method="POST" name="MyForm" >
<TABlE ALIGN="CENTER" border=1>

<TR>
<TD>Search:</TD>
<TD><INPUT TYPE="TEXT" NAME="SearchData">
</TD>
<TD><INPUT TYPE="SUBMIT" value="Search" name="SearchIt"> </TD>

<%

for Idx = 0 to UBound( Words ) step 1
if SearchAction = "" or Instr( 1, Words(Idx), SearchAction,
vbTextCompare ) <> 0 then
Response.write( "<TR><TD>" & Words(Idx) & "</TD><TD>" & Links(Idx) &
"</TD><TR>" )
end if
next

%>
</TABLE>
</FORM>
</HTML>
</BODY>
</HTML>

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.