combining input text filed and pulldown as search field please help !!
Hello can someone help me with this problem that I am having. I want to put a text field where the user type in and a pull down drop box where they select either first name or last name. I have an .asp code to work already with the text field but I can't combine a text field and drop down box to work. I currently have a two working text box and I want to combine one text box with the drop down with 2 fields for first name and last name.
This is what I have:
man u need to make some combinations wid if and else...in da next page..!
r u handling dis case>>> wat if da user does not enter any text, i.e he only wants to search wid da combo box...and not anything written in text box??
be more specific and i'll help u out...dis is very simple my frnd..!
Thank you omarr226 for your reply..I thought there's no help for this....Well let me explain what I want to do...I have an access database of my musics collection. I want to setup a search webpage with 1 text box where I can type in anything. And a drop/pull down box for me to specify if I want to search by artist name, song title, or disc number. If I don't type anything in the text box and click submit..then just do nothing. Here's my working asp code:
<%
Dim myWhere
Dim strURL
Dim cnnSearch
Dim rstSearch
Dim strDBPath
Dim strSQL
Dim strSearch
Dim strSort
Dim objField ' Used for table display
Select Case strSort
Case "mfcode"
myWhere = "mfcode,track"
Case "track"
myWhere = "track,song"
Case "song"
myWhere = "song"
Case Else
myWhere = "artist"
End Select
%>
<center><table border="1" bordercolor="#0000FF">
<body vlink="#FF0000" alink="#FF0000">
<tr>
<% strSearch = Server.URLEncode(strSearch) ' do NOT do this BEFORE this point! %>
<th bgcolor="#CCCCCC"><a href="emfc.asp?search=<%=strSearch%>&strSort=mfcode"><font color = "#FF0000">Disc Code</a></font color></th>
<th bgcolor="#CCCCCC"><a href="emfc.asp?search=<%=strSearch%>&strSort=track"><font color = "#FF0000">Track Number</a></font color></th>
<th bgcolor="#CCCCCC"><a href="emfc.asp?search=<%=strSearch%>&strSort=song"><font color = "#FF0000">Song Title</a></font color></th>
<th bgcolor="#CCCCCC"><a href="emfc.asp?search=<%=strSearch%>&strSort=artist"><font color = "#FF0000">Artist Name</a></font color></th>
</td>
</tr></body>
<%
blnColor = False
rstSearch.MoveFirst
Do While Not rstSearch.EOF
Response.Write vbTab & "<tr>" & vbCrLf
For Each objField in rstSearch.Fields
Response.Write vbTab & vbTab & "<td bgcolor="""
If blnColor Then
Response.Write "#CCCCFF" ' Light blueish
Else
Response.Write "#FFFFFF" ' White
End If
rstSearch.Close
Set rstSearch = Nothing
cnnSearch.Close
Set cnnSearch = Nothing
End If
%
P.S. On the same note: How would I do or create links to my searched resutls so that when I click on the artist name..It'll pull up all the songs by that artist. ?? For example. I type in the song title "Gold Digger". The results will display like this:
Disc Number: Song Title: Artist: Track:
CD1 Gold Digger Kayne West, Jamie Fox 1
I want the text "Kayne West, Jamie Fox" to be a link so that if I click on Kayne West...it'll refreshh and pulled all the songs by him. Like wise for Jamie Fox...if I click on it..it'll refresh and pull all the songs by Jamie Fox.
Bookmarks