sammySeltzer
asked on
.hta file needs a "Please wait..." message
Hello mates,
I am just dabbling into .hta application development.
The code below works great, just like we want it.
The only missing bit is when a user tries searching the db for records, I need to give the user a message that says, "Search in progress, please wait..."
I have done this tons of times with other languages but having feats giving it a go with .hta.
Any assistance with this bit is highly appreciated.
This is entire working code. Thanks much in advance.
<Edited by SouthMod to remove login credentials>
I am just dabbling into .hta application development.
The code below works great, just like we want it.
The only missing bit is when a user tries searching the db for records, I need to give the user a message that says, "Search in progress, please wait..."
I have done this tons of times with other languages but having feats giving it a go with .hta.
Any assistance with this bit is highly appreciated.
This is entire working code. Thanks much in advance.
<html>
<HTA:APPLICATION ID="oHTA"
APPLICATIONNAME="default"
	 BORDER="thin"
	 BORDERSTYLE="normal"
	 CAPTION="yes"
	 ICON=PBTC.ico
	 MAXIMIZEBUTTON="yes"
	 MINIMIZEBUTTON="yes"
	 SHOWINTASKBAR="no"
	 SINGLEINSTANCE="no"
	 SYSMENU="yes"
	 VERSION=7.2
	 WINDOWSTATE="maximize"
	 contextMenu=no
>
<head>
<script type="text/javascript">
var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="Yes" //Collapse previously open content when opening present? (yes/no)
if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}
function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}
function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}
function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}
function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}
function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}
document.cookie=window.location.pathname+"="+selectedItem
}
function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0"
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
}
if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload
if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate
</script>
<title>PCourt Montly Report</title>
<script language="vbscript">
Dim conn 'GLOBAL doing this here so that all functions can use it
sub dotheconnection
set conn=CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB;Data Source=xx.xx.xx.xx;Network Library=DBMSSOCN;" &_
"Initial Catalog=PCCourt;User ID=MyUserName;Password=MyPassword;"
	If conn.errors.count <> 0 Then
	
		alert("problem connecting to the database")
	else
		' if connected OK call sub getdata
	end if
end sub
sub searchdata
	SQL_query = "SELECT Name, Rel, Estno, dtfild, pub, typeofdocument, btyp, bkno, pgno, disp, dispdt FROM PCS60418_MTHLY_XREF WHERE NAME LIKE '%" & Replace(txtsrch.value, "'", "''") & "%' ORDER BY NAME "
	Set rsData = conn.Execute(SQL_query)
If rsData.EOF Then
	msgbox "No records found. Please refine your search"
else
strHTML = strHTML & "<table cellspacing='0' cellpadding='4' border='0' width='100%'>"
	strHTML = strHTML & "<tr style='background-color:#69C; color:#FFFFFF; font-size: x-small;font-weight:bold'>"
	strHTML = strHTML & "<th>NAME</th>"
	strHTML = strHTML & "<th>REL</th>"
	strHTML = strHTML & "<th>ESTATE NO</th>"
	strHTML = strHTML & "<th>DATE FILLED</th>"
	strHTML = strHTML & "<th>PUB</th>"
	strHTML = strHTML & "<th>TYPE OF DOCUMENT</th>"
	strHTML = strHTML & "<th>BOOK TYPE</th>"
	strHTML = strHTML & "<th>BOOK NO</th>"
	strHTML = strHTML & "<th>PAGE NO</th>"
	strHTML = strHTML & "<th>DISPOSITION</th>"
	strHTML = strHTML & "<th>DISP DATE</th>"
strHTML = strHTML & "</tr>"
Dim colorset, numcolors
	 '/--- This is the array of colors to use. -------------\
	 colorset = split("gainsboro,White",",")
	 numcolors = ubound(colorset)+1
priorRec=""
Do Until rsData.EOF
curRec= rsData("Name")
curRel = rsData("Rel")
If curRec <> priorRec Then
strHTML = strHTML & "<tr>"
strHTML = strHTML & "<td style='background:gainsboro;font-size: x-small;'>" & rsData("Name") & "</td>"
strHTML = strHTML & "<td style='background:gainsboro;font-size: x-small;font-size: x-small;'>" & rsData("REL") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("ESTNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DTFILD") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("PUB") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("TypeOfDocument") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("BTYP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("BKNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("PGNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DISP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DISPDT") & "</td>"
strHTML = strHTML & "</tr><tr>"
priorRec = curRec
priorRel = curRel
Else
strHTML = strHTML & "<tr>"
strHTML = strHTML & "<td style='background:White;font-size: x-small;'> </td>"
strHTML = strHTML & "<td style='background:White;font-size: x-small;'> </td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("ESTNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DTFILD") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("PUB") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("TypeOfDocument") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("BTYP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("BKNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("PGNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DISP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DISPDT") & "</td>"
strHTML = strHTML & "</tr>"
end if
i = i + 1
rsData.MoveNext
Loop
strHTML = strHTML & "</table>"
searchIT.innerHTML = strHTML
end if
end sub
</script>
<style>
<!--
fieldset { border: 1 solid #000080 }
font { font-family: Verdana; font-size: 10pt }
-->
</style>
<LINK href="/probateCT/include/template.css" rel="stylesheet" type="text/css">
</head>
<body onload="dotheconnection" language="vbscript" background="images/fond.gif">
<font face="Verdana" size="2">
<div align=center><input type="button" style="width: 580px;" value="Search Probate Court Monthly Report Database Click here>>>" onClick="expandcontent('sc2')" style="font-size: medium; font-weight: bold; color:#ffffff; background-color:#69C;"></div>
<div id="sc2" class="switchcontent">
<div align="center">
<table border="0" width="470" height="16">
<tr>
<td height="6" class="bgtop" nowrap>
<b><font style="font-size: medium; font-weight: bold; color:#ffffff;">Enter Name:</font></b></td>
<td width="487" height="7"><b><font face="Verdana" size="2"><input type="text" name="txtsrch" size="43"></font></b><input type="button" name="btnSearch" class="bgtop" value="Go" onclick="searchdata" language="vbscript" style="font-size: medium; font-weight: bold; color:#ffffff; background-color:#6e6e6e;">
</td>
</tr><tr><td width="126"></td><td width="487"><b><font color="#000080" size="2" face="Verdana">
You can search by a keyword e.g.; Gibbs<br>
You can also search in the format of Lastname, Firstname Middle name.<br>
Example: Adams, Eva Gibbs</font></b>
</td>
</tr>
</table>
</div>
<fieldset>
<legend><b><font style="font-size: medium; font-weight: bold; color:#6e6e6e; background-color:gainsboro;">Search Results</font></b></legend>
<center><div style="width: 950; height: 500; overflow: auto; border: 0px solid black" id="searchIT"></div>
</center>
</fieldset>
</body>
</script>
<Edited by SouthMod to remove login credentials>
maybe you can do this by showing an animated gif, in a div that you make visible,or in a new window...
ASKER
if you don't mind, can you please show me an example?
I have pretty much tried all I know, including js but no love.
Thanks alot
I have pretty much tried all I know, including js but no love.
Thanks alot
I responded to your other post, think you posted it twice. Here is some code to do it. I generally use an IE window since the HTA won't always update correctly.
Set oIE = CreateObject("InternetExplorer.Application")
Call CreatePopup()
Wscript.Sleep 5000
oIE.Quit
Set oIE = Nothing
'**************************************************************************
'Creates the progress bar so the user sees that the process is running
'**************************************************************************
Sub CreatePopup()
On Error Resume Next
sPBTitle = "Please Wait"
iWindowWidth = 300
iWindowHeight = 100
With oIE
.Navigate "about:blank"
.ToolBar = False
.StatusBar = False
.MenuBar = False
.Resizable = False
.Width = iWindowWidth
.Height = iWindowHeight
.Left = (.Document.ParentWindow.Screen.AvailWidth - iWindowWidth) / 2
.Top = (.Document.ParentWindow.Screen.AvailHeight - iWindowHeight) / 2
With .Document
.Open
.Write "<html><head><title>" & sPBTitle & "</title></head>" &_
"<body bgcolor=""buttonface"">" &_
"Search in progress, please wait..." &_
"</body></html>"
.Close
.Title = sPBTitle
End With
.Visible = True
End With
Do While oIE.Busy : WScript.Sleep 100 : Loop
End Sub
ASKER
Thanks spinzr0,
That other copy was created in error.
My network disconnected while I was posting and I assumed that original attempt failed.
I have a couple of question.
1, I am getting "object required: Wscript"
I tried setting this:
set WshShell = CreateObject("WScript.Shel l") but it didn't help.
2, Is all I need to do just use that code assuming all the bugs are worked out.
.hta is a new territory for me. I am still trying to figure out the nuances.
Thanks for your help.
That other copy was created in error.
My network disconnected while I was posting and I assumed that original attempt failed.
I have a couple of question.
1, I am getting "object required: Wscript"
I tried setting this:
set WshShell = CreateObject("WScript.Shel
2, Is all I need to do just use that code assuming all the bugs are worked out.
.hta is a new territory for me. I am still trying to figure out the nuances.
Thanks for your help.
Sorry, should've been more clear. You don't need to line Wscript.Sleep I was just using that as my demo. For your hta, put in these lines:
Set oIE = CreateObject("InternetExpl orer.Appli cation")
Call CreatePopup()
Then, run your query. After the query, run these lines to close the prompt:
oIE.Quit
Set oIE = Nothing
Then just throw the function in where convenient.
Set oIE = CreateObject("InternetExpl
Call CreatePopup()
Then, run your query. After the query, run these lines to close the prompt:
oIE.Quit
Set oIE = Nothing
Then just throw the function in where convenient.
ASKER
I will complete this tomorrow.
My vpn is letting me down big time. It keeps timing out, givin the message that the script has become unresponsive.
But just to be sure I am the right track, could you please see where I am placing your code, particularly these lines:
Set oIE = CreateObject("InternetExpl orer.Appli cation")
Call CreatePopup()
Then, run your query. After the query, run these lines to close the prompt:
oIE.Quit
Set oIE = Nothing
Thanks again for your assistance
My vpn is letting me down big time. It keeps timing out, givin the message that the script has become unresponsive.
But just to be sure I am the right track, could you please see where I am placing your code, particularly these lines:
Set oIE = CreateObject("InternetExpl
Call CreatePopup()
Then, run your query. After the query, run these lines to close the prompt:
oIE.Quit
Set oIE = Nothing
Thanks again for your assistance
sub searchdata
Set oIE = CreateObject("InternetExplorer.Application")
Call CreatePopup()
SQL_query = "SELECT Name, Rel, Estno, dtfild, pub, typeofdocument, btyp, bkno, pgno, disp, dispdt FROM PCS60418_MTHLY_XREF WHERE NAME LIKE '%" & Replace(txtsrch.value, "'", "''") & "%' ORDER BY NAME "
Set rsData = conn.Execute(SQL_query)
oIE.Quit
Set oIE = Nothing
If rsData.EOF Then
msgbox "No records found. Please refine your search"
else
strHTML = strHTML & "<table cellspacing='0' cellpadding='4' border='0' width='100%'>"
strHTML = strHTML & "<tr style='background-color:#69C; color:#FFFFFF; font-size: x-small;font-weight:bold'>"
strHTML = strHTML & "<th>NAME</th>"
strHTML = strHTML & "<th>REL</th>"
strHTML = strHTML & "<th>ESTATE NO</th>"
strHTML = strHTML & "<th>DATE FILLED</th>"
strHTML = strHTML & "<th>PUB</th>"
strHTML = strHTML & "<th>TYPE OF DOCUMENT</th>"
strHTML = strHTML & "<th>BOOK TYPE</th>"
strHTML = strHTML & "<th>BOOK NO</th>"
strHTML = strHTML & "<th>PAGE NO</th>"
strHTML = strHTML & "<th>DISPOSITION</th>"
strHTML = strHTML & "<th>DISP DATE</th>"
strHTML = strHTML & "</tr>"
Dim colorset, numcolors
'/--- This is the array of colors to use. -------------\
colorset = split("gainsboro,White",",")
numcolors = ubound(colorset)+1
priorRec=""
Do Until rsData.EOF
curRec= rsData("Name")
curRel = rsData("Rel")
If curRec <> priorRec Then
strHTML = strHTML & "<tr>"
strHTML = strHTML & "<td style='background:gainsboro;font-size: x-small;'>" & rsData("Name") & "</td>"
strHTML = strHTML & "<td style='background:gainsboro;font-size: x-small;font-size: x-small;'>" & rsData("REL") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("ESTNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DTFILD") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("PUB") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("TypeOfDocument") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("BTYP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("BKNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("PGNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DISP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DISPDT") & "</td>"
strHTML = strHTML & "</tr><tr>"
priorRec = curRec
priorRel = curRel
Else
strHTML = strHTML & "<tr>"
strHTML = strHTML & "<td style='background:White;font-size: x-small;'> </td>"
strHTML = strHTML & "<td style='background:White;font-size: x-small;'> </td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("ESTNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DTFILD") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("PUB") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("TypeOfDocument") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("BTYP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("BKNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("PGNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DISP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DISPDT") & "</td>"
strHTML = strHTML & "</tr>"
end if
i = i + 1
rsData.MoveNext
Loop
strHTML = strHTML & "</table>"
searchIT.innerHTML = strHTML
end if
end sub
'**************************************************************************
'Creates the progress bar so the user sees that the process is running
'**************************************************************************
Sub CreatePopup()
On Error Resume Next
sPBTitle = "Please Wait"
iWindowWidth = 300
iWindowHeight = 100
With oIE
.Navigate "about:blank"
.ToolBar = False
.StatusBar = False
.MenuBar = False
.Resizable = False
.Width = iWindowWidth
.Height = iWindowHeight
.Left = (.Document.ParentWindow.Screen.AvailWidth - iWindowWidth) / 2
.Top = (.Document.ParentWindow.Screen.AvailHeight - iWindowHeight) / 2
With .Document
.Open
.Write "<html><head><title>" & sPBTitle & "</title></head>" &_
"<body bgcolor=""buttonface"">" &_
"Search in progress, please wait..." &_
"</body></html>"
.Close
.Title = sPBTitle
End With
.Visible = True
End With
Do While oIE.Busy : WScript.Sleep 100 : Loop
End Sub
</script>
<style>
<!--
fieldset { border: 1 solid #000080 }
font { font-family: Verdana; font-size: 10pt }
-->
</style>
<LINK href="/probateCT/include/template.css" rel="stylesheet" type="text/css">
</head>
<body onload="dotheconnection" language="vbscript" background="images/fond.gif">
<font face="Verdana" size="2">
<div align=center><input type="button" style="width: 580px;" value="Search Probate Court Monthly Report Database Click here>>>" onClick="expandcontent('sc2')" style="font-size: medium; font-weight: bold; color:#ffffff; background-color:#69C;"></div>
<div id="sc2" class="switchcontent">
<div align="center">
<table border="0" width="470" height="16">
<tr>
<td height="6" class="bgtop" nowrap>
<b><font style="font-size: medium; font-weight: bold; color:#ffffff;">Enter Name:</font></b></td>
<td width="487" height="7"><b><font face="Verdana" size="2"><input type="text" name="txtsrch" size="43"></font></b><input type="button" name="btnSearch" class="bgtop" value="Go" onclick="searchdata" language="vbscript" style="font-size: medium; font-weight: bold; color:#ffffff; background-color:#6e6e6e;">
</td>
</tr><tr><td width="126"></td><td width="487"><b><font color="#000080" size="2" face="Verdana">
You can search by a keyword e.g.; Gibbs<br>
You can also search in the format of Lastname, Firstname Middle name.<br>
Example: Adams, Eva Gibbs</font></b>
</td>
</tr>
</table>
</div>
<fieldset>
<legend><b><font style="font-size: medium; font-weight: bold; color:#6e6e6e; background-color:gainsboro;">Search Results</font></b></legend>
<center><div style="width: 950; height: 500; overflow: auto; border: 0px solid black" id="searchIT"></div>
</center>
</fieldset>
</body>
</script>
yeah, that looks good to me. As a note, you can also add the line conn.CommandTimeout = 300 to make the timeout longer. The timeout is in seconds so make it as long as needed.
ASKER
Please see attached screenshot. This is the error I am getting.
Man, I didn't realize that just include a message such as "please wait" is going to be such a pain.
Thanks much for any thing else you can do
scripterror.JPG
Man, I didn't realize that just include a message such as "please wait" is going to be such a pain.
Thanks much for any thing else you can do
scripterror.JPG
ASKER
well, the script alert box doesn't come up anymore but nothing else changed.
Even a simple search that used to take less than 2 seconds, this time, took so long that I had to end it.
More importantly, the "Please wait..." message doesn't come up.
Even a simple search that used to take less than 2 seconds, this time, took so long that I had to end it.
More importantly, the "Please wait..." message doesn't come up.
did you add the reg key HKEY_CURRENT_USER\Software \Microsoft \Internet Explorer\Styles and add the DWORD "MaxScriptStatements" with a value of "0xFFFFFFFF"? I've actually never had the error you said and I use IE dialogs all the time.
ASKER
Yes, I did and like I stated, the error disappeared which was the intended purpose of going to regedit.
The issue of not displaying the message persits, plus the query now degenerates into infinite loop.
There is some slight news though.
Currently, I was able to display the "Please wait" message but there is one problem.
It doesn't display the message during search wait time.
It displays the message *after* your search results have been displayed to the screen and it stays there till you close the screen.
Do you think you can help me manipulate this to make it work?
Please notice <span id=lblstatus>
thx
The issue of not displaying the message persits, plus the query now degenerates into infinite loop.
There is some slight news though.
Currently, I was able to display the "Please wait" message but there is one problem.
It doesn't display the message during search wait time.
It displays the message *after* your search results have been displayed to the screen and it stays there till you close the screen.
Do you think you can help me manipulate this to make it work?
Please notice <span id=lblstatus>
thx
sub searchdata
lblStatus.innerText = "Search in progress. Please wait ... This process could take several minutes to complete."
SQL_query = "SELECT Name, Rel, Estno, dtfild, pub, typeofdocument, btyp, bkno, pgno, disp, dispdt FROM PCS60418_MTHLY_XREF WHERE NAME LIKE '%" & Replace(txtsrch.value, "'", "''") & "%' ORDER BY NAME "
Set rsData = conn.Execute(SQL_query)
If rsData.EOF Then
msgbox "No records found. Please refine your search"
else
strHTML = strHTML & "<table cellspacing='0' cellpadding='4' border='0' width='100%'>"
strHTML = strHTML & "<tr style='background-color:#69C; color:#FFFFFF; font-size: x-small;font-weight:bold'>"
strHTML = strHTML & "<th>NAME</th>"
strHTML = strHTML & "<th>REL</th>"
strHTML = strHTML & "<th>ESTATE NO</th>"
strHTML = strHTML & "<th>DATE FILLED</th>"
strHTML = strHTML & "<th>PUB</th>"
strHTML = strHTML & "<th>TYPE OF DOCUMENT</th>"
strHTML = strHTML & "<th>BOOK TYPE</th>"
strHTML = strHTML & "<th>BOOK NO</th>"
strHTML = strHTML & "<th>PAGE NO</th>"
strHTML = strHTML & "<th>DISPOSITION</th>"
strHTML = strHTML & "<th>DISP DATE</th>"
strHTML = strHTML & "</tr>"
Dim colorset, numcolors
'/--- This is the array of colors to use. -------------\
colorset = split("gainsboro,White",",")
numcolors = ubound(colorset)+1
priorRec=""
Do Until rsData.EOF
curRec= rsData("Name")
If curRec <> priorRec Then
strHTML = strHTML & "<tr>"
strHTML = strHTML & "<td style='background:gainsboro;font-size: x-small;'>" & rsData("Name") & "</td>"
strHTML = strHTML & "<td style='background:gainsboro;font-size: x-small;font-size: x-small;'>" & rsData("REL") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("ESTNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DTFILD") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("PUB") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("TypeOfDocument") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("BTYP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("BKNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("PGNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DISP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DISPDT") & "</td>"
strHTML = strHTML & "</tr><tr>"
priorRec = curRec
Else
strHTML = strHTML & "<tr>"
strHTML = strHTML & "<td style='background:White;font-size: x-small;'> </td>"
strHTML = strHTML & "<td style='background:White;font-size: x-small;'> </td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("ESTNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DTFILD") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("PUB") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("TypeOfDocument") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("BTYP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("BKNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("PGNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DISP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DISPDT") & "</td>"
strHTML = strHTML & "</tr>"
end if
i = i + 1
rsData.MoveNext
Loop
strHTML = strHTML & "</table>"
searchIT.innerHTML = strHTML
end if
end sub
</script>
<style>
<!--
fieldset { border: 1 solid #000080 }
font { font-family: Verdana; font-size: 10pt }
-->
</style>
<LINK href="/probateCT/include/template.css" rel="stylesheet" type="text/css">
</head>
<body onload="dotheconnection" language="vbscript" background="images/fond.gif">
<font face="Verdana" size="2">
<div align=center><input type="button" style="width: 580px;" value="Search Probate Court Monthly Report Database Click here>>>" onClick="expandcontent('sc2')" style="font-size: medium; font-weight: bold; color:#ffffff; background-color:#69C;"></div>
<div id="sc2" class="switchcontent">
<div align="center">
<table border="0" width="470" height="16">
<tr>
<td height="6" class="bgtop" nowrap>
<b><font style="font-size: medium; font-weight: bold; color:#ffffff;">Enter Name:</font></b></td>
<td width="487" height="7"><b><font face="Verdana" size="2"><input type="text" name="txtsrch" size="43"></font></b><input type="button" name="btnSearch" class="bgtop" value="Go" onclick="searchdata" language="vbscript" style="font-size: medium; font-weight: bold; color:#ffffff; background-color:#6e6e6e;">
</td>
</tr><tr><td width="126"></td><td width="487"><b><font color="#000080" size="2" face="Verdana">
You can search by a keyword e.g.; Gibbs<br>
You can also search in the format of Lastname, Firstname Middle name.<br>
Example: Adams, Eva Gibbs</font></b>
</td>
</tr>
</table>
</div>
<span id="lblStatus"></span>
<fieldset>
<legend><b><font style="font-size: medium; font-weight: bold; color:#6e6e6e; background-color:gainsboro;">Search Results</font></b></legend>
<center><div style="width: 950; height: 500; overflow: auto; border: 0px solid black" id="searchIT"></div>
</center>
</fieldset>
</body>
</script>
Updating the HTA window with the message won't work because it won't actually refresh the screen until the entire function SearchData has finished. Thats why I generaly pop up an IE window. I actually found a small bug in what i posted. Try this. Also, delete that registry key since it isn't helping.
Set oIE = CreateObject("InternetExplorer.Application")
Call CreatePopup()
Call SearchData()
oIE.Quit
Set oIE = Nothing
'**************************************************************************
'Creates the progress bar so the user sees that the process is running
'**************************************************************************
Sub CreatePopup()
On Error Resume Next
sPBTitle = "Please Wait"
iWindowWidth = 300
iWindowHeight = 100
With oIE
.Navigate "about:blank"
.ToolBar = False
.StatusBar = False
.MenuBar = False
.Resizable = False
.Width = iWindowWidth
.Height = iWindowHeight
.Left = (.Document.ParentWindow.Screen.AvailWidth - iWindowWidth) / 2
.Top = (.Document.ParentWindow.Screen.AvailHeight - iWindowHeight) / 2
With .Document
.Open
.Write "<html><head><title>" & sPBTitle & "</title></head>" &_
"<body bgcolor=""buttonface"">" &_
"Search in progress, please wait..." &_
"</body></html>"
.Close
.Title = sPBTitle
End With
.Visible = True
End With
Do While oIE.Busy : Call Sleep(.1) : Loop
End Sub
'************************************************************************************
' Replacement for Wscript.Sleep
'************************************************************************************
Sub Sleep(iSeconds)
On Error Resume Next
If Not IsObject(oWShell) Then _
Set oWShell = CreateObject("Wscript.Shell")
sSleepCommand = "%COMSPEC% /c ping -n " & 1 + iSeconds & " 127.0.0.1>nul"
oWShell.Run sSleepCommand, 0, True
End Sub
ASKER
The message box pop ups but not while search is being processed; not after the search is done but after your search is done and you start to close the screen.
what is so frustrating is that I use this simple-minded code below to do this messaging thing in .net or classic asp.
This .hta thing is a bit annoying.
what is so frustrating is that I use this simple-minded code below to do this messaging thing in .net or classic asp.
This .hta thing is a bit annoying.
<script>
var msg = {
effect: function(st) {
this.show('load');
},
show: function(el) {
this.getID(el).style.display = '';
},
getID: function(el) {
return document.getElementById(el);
}
}
</script>
<body>
<div id="load" style="display:none;">Loading...Please Wait</div>
<div style="float:right;">
<INPUT TYPE="image" src="/fcdcs/images/print.gif" VALUE="Print" onClick="msg.effect(); location='/fcdcs/Reports/Intake_CasesRPT/CasesReport.asp?chsid=<%=currentchsid%>'">
</div>
</body>
Is it just popped up behind this screen? Can you verify? If so, they I can all the focus to it to bring it forward.
ASKER
yes,that was the case.
However,here are the different issues I am facing.
1, Now, I am getting "object required: txtsrch" That's my search param and I wasn't getting this before.
Also, the message supposed to show in status bar?
This is really not a big deal though.
Thanks for your continued assistance and sorry for late reply. I am having feats with my vpn.
It is adding to my stress.
However,here are the different issues I am facing.
1, Now, I am getting "object required: txtsrch" That's my search param and I wasn't getting this before.
Also, the message supposed to show in status bar?
This is really not a big deal though.
Thanks for your continued assistance and sorry for late reply. I am having feats with my vpn.
It is adding to my stress.
Yeah, I feel your frustrations. HTA can be very annoying and VPN can be a pain. As for the error, can I see your code? Can you re-post the current code?
ASKER
Please pardon the length.
Here is the entire current code.
Here is the entire current code.
<html>
<HTA:APPLICATION ID="oHTA"
APPLICATIONNAME="default"
BORDER="thin"
BORDERSTYLE="normal"
CAPTION="yes"
ICON=PBTC.ico
MAXIMIZEBUTTON="yes"
MINIMIZEBUTTON="yes"
SHOWINTASKBAR="no"
SINGLEINSTANCE="no"
SYSMENU="yes"
VERSION=7.2
WINDOWSTATE="maximize"
contextMenu=no
>
<head>
<script type="text/javascript">
var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="Yes" //Collapse previously open content when opening present? (yes/no)
if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}
function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}
function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}
function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}
function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}
function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}
document.cookie=window.location.pathname+"="+selectedItem
}
function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0"
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
}
if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload
if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate
</script>
<LINK href="include/loadingNew.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="include/loadingNew.js"></script>
<title>Probate Court Montly Report</title>
<script language="vbscript">
Dim conn 'GLOBAL doing this here so that all functions can use it
sub dotheconnection
set conn=CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB;Data Source=xx.xx.xx.xx,1433;Network Library=DBMSSOCN;" &_
"Initial Catalog=PCt;User ID=MyUserName;Password=MyPassword;"
If conn.errors.count <> 0 Then
alert("problem connecting to the database")
else
' if connected OK call sub getdata
end if
end sub
sub searchdata
SQL_query = "SELECT Name, Rel, Estno, dtfild, pub, typeofdocument, btyp, bkno, pgno, disp, dispdt FROM PCS60418_MTHLY_XREF WHERE NAME LIKE '%" & Replace(txtsrch.value, "'", "''") & "%' ORDER BY NAME "
Set rsData = conn.Execute(SQL_query)
If rsData.EOF Then
msgbox "No records found. Please refine your search"
else
strHTML = strHTML & "<table cellspacing='0' cellpadding='4' border='0' width='100%'>"
strHTML = strHTML & "<tr style='background-color:#69C; color:#FFFFFF; font-size: x-small;font-weight:bold'>"
strHTML = strHTML & "<th>NAME</th>"
strHTML = strHTML & "<th>REL</th>"
strHTML = strHTML & "<th>ESTATE NO</th>"
strHTML = strHTML & "<th>DATE FILLED</th>"
strHTML = strHTML & "<th>PUB</th>"
strHTML = strHTML & "<th>TYPE OF DOCUMENT</th>"
strHTML = strHTML & "<th>BOOK TYPE</th>"
strHTML = strHTML & "<th>BOOK NO</th>"
strHTML = strHTML & "<th>PAGE NO</th>"
strHTML = strHTML & "<th>DISPOSITION</th>"
strHTML = strHTML & "<th>DISP DATE</th>"
strHTML = strHTML & "</tr>"
Dim colorset, numcolors
'/--- This is the array of colors to use. -------------\
colorset = split("gainsboro,White",",")
numcolors = ubound(colorset)+1
priorRec=""
Do Until rsData.EOF
curRec= rsData("Name")
If curRec <> priorRec Then
strHTML = strHTML & "<tr>"
strHTML = strHTML & "<td style='background:gainsboro;font-size: x-small;'>" & rsData("Name") & "</td>"
strHTML = strHTML & "<td style='background:gainsboro;font-size: x-small;font-size: x-small;'>" & rsData("REL") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("ESTNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DTFILD") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("PUB") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("TypeOfDocument") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("BTYP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("BKNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("PGNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DISP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DISPDT") & "</td>"
strHTML = strHTML & "</tr><tr>"
priorRec = curRec
Else
strHTML = strHTML & "<tr>"
strHTML = strHTML & "<td style='background:White;font-size: x-small;'> </td>"
strHTML = strHTML & "<td style='background:White;font-size: x-small;'> </td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("ESTNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DTFILD") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("PUB") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("TypeOfDocument") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("BTYP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("BKNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("PGNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DISP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DISPDT") & "</td>"
strHTML = strHTML & "</tr>"
end if
i = i + 1
rsData.MoveNext
Loop
strHTML = strHTML & "</table>"
searchIT.innerHTML = strHTML
end if
end sub
Set oIE = CreateObject("InternetExplorer.Application")
Call CreatePopup()
Call searchdata()
oIE.Quit
Set oIE = Nothing
'**************************************************************************
'Creates the progress bar so the user sees that the process is running
'**************************************************************************
Sub CreatePopup()
On Error Resume Next
sPBTitle = "Please Wait"
iWindowWidth = 300
iWindowHeight = 100
With oIE
.Navigate "about:blank"
.ToolBar = False
.StatusBar = False
.MenuBar = False
.Resizable = False
.Width = iWindowWidth
.Height = iWindowHeight
.Left = (.Document.ParentWindow.Screen.AvailWidth - iWindowWidth) / 2
.Top = (.Document.ParentWindow.Screen.AvailHeight - iWindowHeight) / 2
With .Document
.Open
.Write "<html><head><title>" & sPBTitle & "</title></head>" &_
"<body bgcolor=""buttonface"">" &_
"Search in progress, please wait..." &_
"</body></html>"
.Close
.Title = sPBTitle
End With
.Visible = True
End With
Do While oIE.Busy : Call Sleep(.1) : Loop
End Sub
'************************************************************************************
' Replacement for Wscript.Sleep
'************************************************************************************
Sub Sleep(iSeconds)
On Error Resume Next
If Not IsObject(oWShell) Then _
Set oWShell = CreateObject("Wscript.Shell")
sSleepCommand = "%COMSPEC% /c ping -n " & 1 + iSeconds & " 10.48.5.120,1433>nul"
oWShell.Run sSleepCommand, 0, True
End Sub
</script>
<style>
<!--
fieldset { border: 1 solid #000080 }
font { font-family: Verdana; font-size: 10pt }
-->
</style>
<LINK href="/probateCT/include/template.css" rel="stylesheet" type="text/css">
</head>
<body onload="dotheconnection" language="vbscript" background="images/fond.gif">
<font face="Verdana" size="2">
<div align=center><input type="button" style="width: 580px;" value="Search Probate Court Monthly Report Database Click here>>>" onClick="expandcontent('sc2')" style="font-size: medium; font-weight: bold; color:#ffffff; background-color:#69C;"></div>
<div id="sc2" class="switchcontent">
<div align="center">
<table border="0" width="470" height="16">
<tr>
<td height="6" class="bgtop" nowrap>
<b><font style="font-size: medium; font-weight: bold; color:#ffffff;">Enter Name:</font></b></td>
<td width="487" height="7"><b><font face="Verdana" size="2"><input type="text" name="txtsrch" size="43"></font></b><input type="button" name="btnSearch" class="bgtop" value="Go" onclick="searchdata" language="vbscript" style="font-size: medium; font-weight: bold; color:#ffffff; background-color:#6e6e6e;">
</td>
</tr><tr><td width="126"></td><td width="487"><b><font color="#000080" size="2" face="Verdana">
You can search by a keyword e.g.; Gibbs<br>
You can also search in the format of Lastname, Firstname Middle name.<br>
Example: Adams, Eva Gibbs</font></b>
</td>
</tr>
</table>
</div>
<fieldset>
<legend><b><font style="font-size: medium; font-weight: bold; color:#6e6e6e; background-color:gainsboro;">Search Results</font></b></legend>
<center><div style="width: 950; height: 500; overflow: auto; border: 0px solid black" id="searchIT"></div>
</center>
</fieldset>
</body>
</script>
Give this a shot
<html>
<HTA:APPLICATION ID="oHTA"
APPLICATIONNAME="default"
BORDER="thin"
BORDERSTYLE="normal"
CAPTION="yes"
ICON=PBTC.ico
MAXIMIZEBUTTON="yes"
MINIMIZEBUTTON="yes"
SHOWINTASKBAR="no"
SINGLEINSTANCE="no"
SYSMENU="yes"
VERSION=7.2
WINDOWSTATE="maximize"
contextMenu=no
>
<head>
<script type="text/javascript">
var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="Yes" //Collapse previously open content when opening present? (yes/no)
if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}
function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}
function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}
function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}
function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}
function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}
document.cookie=window.location.pathname+"="+selectedItem
}
function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0"
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
}
if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload
if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate
</script>
<LINK href="include/loadingNew.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="include/loadingNew.js"></script>
<title>Probate Court Montly Report</title>
<script language="vbscript">
Dim conn 'GLOBAL doing this here so that all functions can use it
sub dotheconnection
set conn=CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB;Data Source=xx.xx.xx.xx,1433;Network Library=DBMSSOCN;" &_
"Initial Catalog=PCt;User ID=MyUserName;Password=MyPassword;"
If conn.errors.count <> 0 Then
alert("problem connecting to the database")
else
' if connected OK call sub getdata
end if
end sub
sub searchdata
Set oService = getobject("winmgmts:")
Set dIE = CreateObject("Scripting.Dictionary")
For each oProcess in oService.InstancesOf("Win32_process")
If LCase(oProcess.Name) = "iexplore.exe" Then
dIE.Add oProcess.processid, 1
End If
Next
Set oIE = CreateObject("InternetExplorer.Application")
For Each oProcess in oService.InstancesOf("Win32_process")
If LCase(oProcess.Name) = "iexplore.exe" Then
If Not dIE.Exists(oProcess.processid) Then
iProcessID = oProcess.processid
Exit For
End If
End If
Next
Call CreatePopup()
CreateObject("Wscript.Shell").AppActivate(iProcessID)
Set dIE = Nothing
Set oService = Nothing
sTemp = txtsrch.value
SQL_query = "SELECT Name, Rel, Estno, dtfild, pub, typeofdocument, btyp, bkno, pgno, disp, dispdt FROM PCS60418_MTHLY_XREF WHERE NAME LIKE '%" & Replace(sTemp, "'", "''") & "%' ORDER BY NAME "
Set rsData = conn.Execute(SQL_query)
If rsData.EOF Then
msgbox "No records found. Please refine your search"
else
strHTML = strHTML & "<table cellspacing='0' cellpadding='4' border='0' width='100%'>"
strHTML = strHTML & "<tr style='background-color:#69C; color:#FFFFFF; font-size: x-small;font-weight:bold'>"
strHTML = strHTML & "<th>NAME</th>"
strHTML = strHTML & "<th>REL</th>"
strHTML = strHTML & "<th>ESTATE NO</th>"
strHTML = strHTML & "<th>DATE FILLED</th>"
strHTML = strHTML & "<th>PUB</th>"
strHTML = strHTML & "<th>TYPE OF DOCUMENT</th>"
strHTML = strHTML & "<th>BOOK TYPE</th>"
strHTML = strHTML & "<th>BOOK NO</th>"
strHTML = strHTML & "<th>PAGE NO</th>"
strHTML = strHTML & "<th>DISPOSITION</th>"
strHTML = strHTML & "<th>DISP DATE</th>"
strHTML = strHTML & "</tr>"
Dim colorset, numcolors
'/--- This is the array of colors to use. -------------\
colorset = split("gainsboro,White",",")
numcolors = ubound(colorset)+1
priorRec=""
Do Until rsData.EOF
curRec= rsData("Name")
If curRec <> priorRec Then
strHTML = strHTML & "<tr>"
strHTML = strHTML & "<td style='background:gainsboro;font-size: x-small;'>" & rsData("Name") & "</td>"
strHTML = strHTML & "<td style='background:gainsboro;font-size: x-small;font-size: x-small;'>" & rsData("REL") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("ESTNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DTFILD") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("PUB") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("TypeOfDocument") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("BTYP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("BKNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("PGNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DISP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DISPDT") & "</td>"
strHTML = strHTML & "</tr><tr>"
priorRec = curRec
Else
strHTML = strHTML & "<tr>"
strHTML = strHTML & "<td style='background:White;font-size: x-small;'> </td>"
strHTML = strHTML & "<td style='background:White;font-size: x-small;'> </td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("ESTNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DTFILD") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("PUB") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("TypeOfDocument") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("BTYP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("BKNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("PGNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DISP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DISPDT") & "</td>"
strHTML = strHTML & "</tr>"
end if
i = i + 1
rsData.MoveNext
Loop
strHTML = strHTML & "</table>"
searchIT.innerHTML = strHTML
end if
oIE.Quit
Set oIE = Nothing
end sub
'**************************************************************************
'Creates the progress bar so the user sees that the process is running
'**************************************************************************
Sub CreatePopup()
On Error Resume Next
sPBTitle = "Please Wait"
iWindowWidth = 300
iWindowHeight = 100
With oIE
.Navigate "about:blank"
.ToolBar = False
.StatusBar = False
.MenuBar = False
.Resizable = False
.Width = iWindowWidth
.Height = iWindowHeight
.Left = (.Document.ParentWindow.Screen.AvailWidth - iWindowWidth) / 2
.Top = (.Document.ParentWindow.Screen.AvailHeight - iWindowHeight) / 2
With .Document
.Open
.Write "<html><head><title>" & sPBTitle & "</title></head>" &_
"<body bgcolor=""buttonface"">" &_
"Search in progress, please wait..." &_
"</body></html>"
.Close
.Title = sPBTitle
End With
.Visible = True
End With
Do While oIE.Busy : Call Sleep(.1) : Loop
End Sub
'************************************************************************************
' Replacement for Wscript.Sleep
'************************************************************************************
Sub Sleep(iSeconds)
On Error Resume Next
If Not IsObject(oWShell) Then _
Set oWShell = CreateObject("Wscript.Shell")
sSleepCommand = "%COMSPEC% /c ping -n " & 1 + iSeconds & " 10.48.5.120,1433>nul"
oWShell.Run sSleepCommand, 0, True
End Sub
</script>
<style>
<!--
fieldset { border: 1 solid #000080 }
font { font-family: Verdana; font-size: 10pt }
-->
</style>
<LINK href="/probateCT/include/template.css" rel="stylesheet" type="text/css">
</head>
<body onload="dotheconnection" language="vbscript" background="images/fond.gif">
<font face="Verdana" size="2">
<div align=center><input type="button" style="width: 580px;" value="Search Probate Court Monthly Report Database Click here>>>" onClick="expandcontent('sc2')" style="font-size: medium; font-weight: bold; color:#ffffff; background-color:#69C;"></div>
<div id="sc2" class="switchcontent">
<div align="center">
<table border="0" width="470" height="16">
<tr>
<td height="6" class="bgtop" nowrap>
<b><font style="font-size: medium; font-weight: bold; color:#ffffff;">Enter Name:</font></b></td>
<td width="487" height="7"><b><font face="Verdana" size="2"><input type="text" name="txtsrch" size="43"></font></b><input type="button" name="btnSearch" class="bgtop" value="Go" onclick="searchdata" language="vbscript" style="font-size: medium; font-weight: bold; color:#ffffff; background-color:#6e6e6e;">
</td>
</tr><tr><td width="126"></td><td width="487"><b><font color="#000080" size="2" face="Verdana">
You can search by a keyword e.g.; Gibbs<br>
You can also search in the format of Lastname, Firstname Middle name.<br>
Example: Adams, Eva Gibbs</font></b>
</td>
</tr>
</table>
</div>
<fieldset>
<legend><b><font style="font-size: medium; font-weight: bold; color:#6e6e6e; background-color:gainsboro;">Search Results</font></b></legend>
<center><div style="width: 950; height: 500; overflow: auto; border: 0px solid black" id="searchIT"></div>
</center>
</fieldset>
</body>
</script>
also, I just noticed a username/password in the code. I've asked an admin to remove it.
ASKER
>>also, I just noticed a username/password in the code. I've asked an admin to remove it.
thx
still same issues i noted earlier.
thx
still same issues i noted earlier.
I don't understand how you can have the same issue. The original placement of the call was not where it should be, so I added it to the searchdata sub. The original error message was because that sub was being called before the page loads. Now, it should be firing on the user action. You get the error when you run the code straight away?
ASKER
yes, let me recopy the code again,just in case the vpn may have interferred with it.
I am in the office today; so my response should be faster.
Please accept my sincere appreciation for your patience.
I will definitely increase the points when all is said and done.
let me copy your latest code again and try it afresh.
back shortly...
I am in the office today; so my response should be faster.
Please accept my sincere appreciation for your patience.
I will definitely increase the points when all is said and done.
let me copy your latest code again and try it afresh.
back shortly...
ASKER
I just ran it and yes, you are right, those issues like showing up at status bar or hiding behind the screen or the txtsrch error are no longer there. They are gone. I am sorry, it must have the vpn frustration I experienced entire weekend.
However, I don't see anything at all.
No data, no "please wait..." message; nothing.
The one thing I noticed though is that normally when you press the "Go" button, the button remains pressed until data loads the screen.
This time, as you press the "Go" button and move your mouse, the button is quickly un-depressed.
Not enough to load data.
I am really sorry for all the headache.
If you have time, I can send you some ddl statements (create table and insert statement with some sample data).
This is only of course if you have time.
This time, all I changed in your latest code is the connection string info. I didn't mess with code.
However, I don't see anything at all.
No data, no "please wait..." message; nothing.
The one thing I noticed though is that normally when you press the "Go" button, the button remains pressed until data loads the screen.
This time, as you press the "Go" button and move your mouse, the button is quickly un-depressed.
Not enough to load data.
I am really sorry for all the headache.
If you have time, I can send you some ddl statements (create table and insert statement with some sample data).
This is only of course if you have time.
This time, all I changed in your latest code is the connection string info. I didn't mess with code.
yeah, I can take a look.
out of curiosity, if you run the original code does it work?
ASKER
Yes, the original code works great.
The only issue which led to my posting it here for assistance is to add a message to users that Search is in progress.
Otherwise, works great.
The only issue which led to my posting it here for assistance is to add a message to users that Search is in progress.
Otherwise, works great.
ASKER
I have incorporated the JavaScript I have into this code and now, I can see the message being displayed nicely.
However, it just sits there and the data is not loading.
If I switch the 2 onclick events, then the data starts loading but the message won't display.
You will see the 2 onclick events in the "Go" button. I is called onclick="searchdata" language="vbscript".
The other is onclick="msg.effect()" language="javascript"
Is there anyway you can manipulate the 2?
I am posting the most recent code and at the botttom of it is the small js script.
However, it just sits there and the data is not loading.
If I switch the 2 onclick events, then the data starts loading but the message won't display.
You will see the 2 onclick events in the "Go" button. I is called onclick="searchdata" language="vbscript".
The other is onclick="msg.effect()" language="javascript"
Is there anyway you can manipulate the 2?
I am posting the most recent code and at the botttom of it is the small js script.
<html>
<HTA:APPLICATION ID="oHTA"
APPLICATIONNAME="default"
BORDER="thin"
BORDERSTYLE="normal"
CAPTION="yes"
ICON=PBTC.ico
MAXIMIZEBUTTON="yes"
MINIMIZEBUTTON="yes"
SHOWINTASKBAR="no"
SINGLEINSTANCE="no"
SYSMENU="yes"
VERSION=7.2
WINDOWSTATE="maximize"
contextMenu=no
>
<head>
<script type="text/javascript">
var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="Yes" //Collapse previously open content when opening present? (yes/no)
if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}
function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}
function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}
function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}
function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}
function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}
document.cookie=window.location.pathname+"="+selectedItem
}
function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0"
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
}
if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload
if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate
</script>
<title>Probate Court Montly Report</title>
<script language="vbscript">
Dim conn 'GLOBAL doing this here so that all functions can use it
sub dotheconnection
set conn=CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB;Data Source=xx.xx.xxxx.xxx,1433;Network Library=DBMSSOCN;" &_
"Initial Catalog=ProbateCourt;User ID=xxxx;Password=xxxx;"
If conn.errors.count <> 0 Then
alert("problem connecting to the database")
else
' if connected OK call sub getdata
end if
end sub
sub searchdata
SQL_query = "SELECT Name, Rel, Estno, dtfild, pub, typeofdocument, btyp, bkno, pgno, disp, dispdt FROM PCS60418_MTHLY_XREF WHERE NAME LIKE '%" & Replace(txtsrch.value, "'", "''") & "%' ORDER BY NAME "
Set rsData = conn.Execute(SQL_query)
If rsData.EOF Then
msgbox "No records found. Please refine your search"
else
strHTML = strHTML & "<table cellspacing='0' cellpadding='4' border='0' width='100%'>"
strHTML = strHTML & "<tr style='background-color:#69C; color:#FFFFFF; font-size: x-small;font-weight:bold'>"
strHTML = strHTML & "<th>NAME</th>"
strHTML = strHTML & "<th>REL</th>"
strHTML = strHTML & "<th>ESTATE NO</th>"
strHTML = strHTML & "<th>DATE FILLED</th>"
strHTML = strHTML & "<th>PUB</th>"
strHTML = strHTML & "<th>TYPE OF DOCUMENT</th>"
strHTML = strHTML & "<th>BOOK TYPE</th>"
strHTML = strHTML & "<th>BOOK NO</th>"
strHTML = strHTML & "<th>PAGE NO</th>"
strHTML = strHTML & "<th>DISPOSITION</th>"
strHTML = strHTML & "<th>DISP DATE</th>"
strHTML = strHTML & "</tr>"
Dim colorset, numcolors
'/--- This is the array of colors to use. -------------\
colorset = split("gainsboro,White",",")
numcolors = ubound(colorset)+1
priorRec=""
Do Until rsData.EOF
curRec= rsData("Name")
If curRec <> priorRec Then
strHTML = strHTML & "<tr>"
strHTML = strHTML & "<td style='background:gainsboro;font-size: x-small;'>" & rsData("Name") & "</td>"
strHTML = strHTML & "<td style='background:gainsboro;font-size: x-small;font-size: x-small;'>" & rsData("REL") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("ESTNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DTFILD") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("PUB") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("TypeOfDocument") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("BTYP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("BKNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("PGNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DISP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;'>" & rsData("DISPDT") & "</td>"
strHTML = strHTML & "</tr><tr>"
priorRec = curRec
Else
strHTML = strHTML & "<tr>"
strHTML = strHTML & "<td style='background:White;font-size: x-small;'> </td>"
strHTML = strHTML & "<td style='background:White;font-size: x-small;'> </td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("ESTNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DTFILD") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("PUB") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("TypeOfDocument") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("BTYP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("BKNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("PGNO") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DISP") & "</td>"
strHTML = strHTML & "<td style='background:" & colorset(i mod numcolors) & ";font-size: x-small;' >" & rsData("DISPDT") & "</td>"
strHTML = strHTML & "</tr>"
end if
i = i + 1
rsData.MoveNext
Loop
strHTML = strHTML & "</table>"
searchIT.innerHTML = strHTML
end if
end sub
</script>
<style>
<!--
fieldset { border: 1 solid #000080 }
font { font-family: Verdana; font-size: 10pt }
-->
</style>
<LINK href="/probateCT/include/template.css" rel="stylesheet" type="text/css">
<LINK href="include/loadingNew.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="include/loadingNew.js"></script>
</head>
<body onload="dotheconnection" language="vbscript" background="images/fond.gif">
<div id="load" style="display:none;">Loading...Please Wait</div>
<font face="Verdana" size="2">
<div align=center><input type="button" style="width: 580px;" value="Search Probate Court Monthly Report Database Click here>>>" onClick="expandcontent('sc2')" style="font-size: medium; font-weight: bold; color:#ffffff; background-color:#69C;"></div>
<div id="sc2" class="switchcontent">
<div align="center">
<table border="0" width="470" height="16">
<tr>
<td height="6" class="bgtop" nowrap>
<b><font style="font-size: medium; font-weight: bold; color:#ffffff;">Enter Name:</font></b></td>
<td width="487" height="7"><b><font face="Verdana" size="2"><input type="text" name="txtsrch" size="43"></font></b><input type="button" name="btnSearch" class="bgtop" onClick="msg.effect()" language="javascript" value="Go" onclick="searchdata" language="vbscript" style="font-size: medium; font-weight: bold; color:#ffffff; background-color:#6e6e6e;">
</td>
</tr><tr><td width="126"></td><td width="487"><b><font color="#000080" size="2" face="Verdana">
You can search by a keyword e.g.; Gibbs<br>
You can also search in the format of Lastname, Firstname Middle name.<br>
Example: Adams, Eva Gibbs</font></b>
</td>
</tr>
</table>
</div>
<fieldset>
<legend><b><font style="font-size: medium; font-weight: bold; color:#6e6e6e; background-color:gainsboro;">Search Results</font></b></legend>
<center><div style="width: 950; height: 500; overflow: auto; border: 0px solid black" id="searchIT"></div>
</center>
</fieldset>
</body>
</script>
**********
JS script
var msg = {
effect: function(st) {
this.show('load');
},
show: function(el) {
this.getID(el).style.display = '';
},
getID: function(el) {
return document.getElementById(el);
}
}
********
Its my understanding that you can only have one onclick call for a button and seperate the calls with a semicolon (link: http://bytes.com/topic/javascript/answers/94266-combining-two-onclick-events). Could that be your issue? Sorry, its harder to diasnose since i can't just run it.
ASKER
yes, usually that's the case if both are js or vbscript.
In this case, one is js and the other is vbscript.
In this case, one is js and the other is vbscript.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.