|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 09/18/2009 at 03:46AM PDT, ID: 24742775 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: |
ASP to process suggestions:
<%
response.expires=-1
Dim rsWords
Dim rsWords_numRows
Dim q
Dim b
Dim hint
q=ucase(request.querystring("q"))
b=(request.querystring("b"))
f=(request.querystring("f"))
a=(request.querystring("a"))
hint=""
Set rsWords = Server.CreateObject("ADODB.Recordset")
rsWords.ActiveConnection = <connection string>
rsWords.Source = "SELECT medName FROM dbo.prescMeds WHERE (medName LIKE'" + q + "%') ORDER BY medName"
rsWords.CursorType = 2
rsWords.CursorLocation = 2
rsWords.LockType = 3
rsWords.Open()
rsWords_numRows = 5
If Not rsWords.EOF Then
Do While Not rsWords.EOF
If trim(hint) = "" Then
hint = "<a href=""javascript:setTextBox('" & rsWords("medName") & "','" & b & "','" & f & "','" & a & "');"">" & rsWords("medName") & "</a>"
Else
hint = hint & " <br /><br /> <a href=""javascript:setTextBox('" & rsWords("medName") & "','" & b & "','" & f & "','" & a & "');"">" & rsWords("medName") & "</a>"
End If
rsWords.MoveNext()
Loop
End If
if trim(hint)="" then
response.write("no suggestion")
else
response.write(hint)
end if
rsWords.Close()
Set rsWords = Nothing
%>
__________________________________________________
Javascript/AJAX to process suggestions:
var xmlHttp
function showHint(str, box, thisForm, autoSubmit)
{
if (str.length==0)
{
document.getElementById("txtHint").innerHTML="";
return;
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="gethint.asp";
url=url+"?q="+str;
url=url+"&b="+box;
url=url+"&f="+thisForm;
url=url+"&a="+autoSubmit;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged()
{
if (xmlHttp.readyState==4)
{
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
//this function allows for Clickable suggestions
function setTextBox(thisText,thisBox,thisForm,autoSubmit){
document.getElementById(thisBox).value = thisText
//this autoSubmits the form after a suggestion is clicked - it is not working :(
//if(autoSubmit=='true'){
// alert(thisForm);
// document.getElementById(thisForm).submit();
//}
}
______________________________________________________________
Form and Div to show suggestions:
<form action="prescriptions4.asp" method="post">
<input type="text" id="txt1" onkeyup="showHint(this.value,'txt1','form1',true)" />
</form>
<div id="txtHint"></div>
|
Advertisement