Jump to content

ahill

Members
  • Posts

    36
  • Joined

  • Last visited

Posts posted by ahill

  1. It's a third-party library. There are several other plugins like that one. That one in particular doesn't say it requires any certain version of jQuery, so I imagine the most recent version would work.

    So I don't need any software installed on my server to use it? do I just put a link into the code to a library?
  2. I am currently using the CSS width: 100% property in my drop down list in my classic asp page. My JavaScript call this asp page and does the work from there. My box displays fine in Google chrome amd wraps the text to the box but the css is ignored in Internet Explorer and runs off the page. Any ideas how to work around this?

  3. Wait now I was able to make it search. I changedterm = Replace( Trim(Request("word")), "'", "''" )TOterm = Replace( Trim(Request("q")), "'", "''" )Since javascript is passing the variable q from index.html to livesearch.asp.-----------------------------------------------------------------------------------My only problem is now is that I have to figure out how to get each result to display on its own line, right now they are all one line.ex.NOWresult1 result2 result3 result4What I wantresult 1result 2result 3result 4

  4. its pulling from my advancedtrouble table in my test database. I had the top 10 * in yesterday by mistake when I posted. It dose not make any noticeable impact though..For the term it should be referencing my database and changing on input of a character. only thing I am confused with is they haveterm = Replace( Trim(Request("word")), "'", "''" )SQL = "select top 10 * mproblem from DBtable where mproblem like '%" & term & "%'"---------------------------------------------------------------------------------------------shouldn't it be something more likeSQL= "select mproblem from DBtable where mproblem like '% %' or mproblem like '"+ term +"'"ORSQL = " select mproblem from DBtable where mproblem like '"% & term & %"'Both of these fail if used

  5. Ok so I was able to find some javascript and then match it to an asp style code. The box drops down with data but it is 1.not filtering 2. filled with every single DB entry for mproblem. any idea where the code is missing to filter? I kind of understand the JS and the asp but it looks somewhat foreign to me index.html---------------------------------- <html><head><script>function showResult(str) {if (str.length==0) {document.getElementById("livesearch").innerHTML="";document.getElementById("livesearch").style.border="0px";return;}if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safarixmlhttp=new XMLHttpRequest();} else { // code for IE6, IE5xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}xmlhttp.onreadystatechange=function() {if (xmlhttp.readyState==4 && xmlhttp.status==200) {document.getElementById("livesearch").innerHTML=xmlhttp.responseText;document.getElementById("livesearch").style.border="1px solid #A5ACB2";}}xmlhttp.open("GET","livesearch.asp?q="+str,true);xmlhttp.send();}</script></head><body><form><input type="text" size="30" onKeyUp="showResult(this.value)"><div id="livesearch"></div></form></body></html> livesearch.asp--------------------------------------</head><body><%term = Replace( Trim(Request("word")), "'", "''" ) ' protect against SQL injection even here!SQL = "select top 10 * mproblem from DBtable where mproblem like '%" & term & "%'"Set conn = Server.CreateObject("ADODB.Connection")Conn.Open "DSN=test;UID=test;PWD=test1234;Database=test"Set RS = conn.Execute(SQL)Response.Write RS.getString()RS.CloseConn.CloseResponse.End%></body></html>

  6. Which language do you want to use other than PHP?

    only thing I have access to right now is classic ASP. ASP.Net isn't installed on the IIS and they wont get around to it till this fall I guess. So only thing I can really work with is classic ASP and javascript
  7. OK, but the code on the backend is the same. The only difference is the Javascript code on the frontend.

    ok. Just looking at the layout it looks like it would be a lot easier to have search suggestions as you type so the user knows that there is and I am hoeing that making it like a Google search will be a lot easier and friendlier to navigate.
  8. Why? That language has been obsolete for over 10 years. The last release was 15 years ago.The thing to know about ASP is that it is just a framework, not a language. It looks like you're learning it using VBScript as the language, which is common but in my opinion VBScript is one of the worse languages. It would be a lot more straight-forward to do the same thing in Javascript, which you can also use with ASP. Most tutorials use VBScript though. But, you're looking for a tutorial on building strings using VBScript by looping through an array. You can use split to break up the list into individual words, and then loop through the array of words to build the SQL query.http://www.w3schools.com/vbscript/func_split.asp

    Eh that's what I was told we had to code in right now and will be switching over to .net later into the fall.
  9. Do you wana always search for "oil" and "type"?I posted an example of the query that you should send to the server if they type in "oil type" like you said as an example. If you run that query you will notice that it returns every record that contains both "oil" and "type". That's how you tell the database to do that, you need to split up whatever they typed into individual words and then loop through them and build the query to search for each word in whatever field you're searching. If they typed 5 words then there would be 5 LIKE clauses, if they only entered 1 word the query would only contain 1 LIKE clause. The % sign is a wildcard character in standard SQL saying that there can be any other characters there.

    So I have to try and write a code that generates a new like clause for every word in the searchbox?
  10. SELECT * FROM DBtable WHERE mproblem LIKE '%oil%' AND mproblem LIKE '%type%'

    so do I actually wana use oil and type in my code or do I want to leave the % % blank or should I actually populate them? The text gets entered in a search box that references the mproblem column on the classic ASP vbscript side. my Dim is mproblem=request("problem")
  11. SELECT * FROM table WHERE field LIKE '%oil%' AND field LIKE '%type%'You could also use OR instead of AND to find any term instead of all terms.

    so I only have one DB column that I am searching which is mproblem so you are sayingSelect * from DBtable WHERE mproblem LIKE % & mproblem & % and field LIKE % &mproblem & %
×
×
  • Create New...