Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not sure where to put JavaScript and how it should look:

Status
Not open for further replies.

nospace52

Technical User
Jan 28, 2003
27
0
0
US
I'm putting together a web page for Supervisors and Employee's. The Superviors will be able to see the reason the person in out in the "Remarks" Field. The database would have a Remark like "Meeting/AM" or "Meeting/PM".
Instead of having 2 databases the person would update 1 and then copy it to another directory and rename the database to
out.mdb.

My question is:
How or what JavaScript would I need in the Employees web page that when a Remark = "Meeting/AM" it would show "AM"
when the web page is open.

Here is what I have so far for the Employees web page.
**Out.asp**
Option Explicit

'Define our variables.
Dim cnnDB, strQuery, rsInfo ,cnndb1 ,authUser


'Create an instance of the Connection object.

Set cnnDB = Server.CreateObject("ADODB.Connection")


'And open it.
cnnDB.Open "out"


'Build our SQL query string.
strQuery = "SELECT OUT.Name, OUT.REMARKS FROM OUT WHERE (((OUT.REMARKS) Is Not Null)) ORDER BY OUT.Name;"

'Execute the query and return a recordset.
Set rsInfo = cnnDB.Execute(strQuery)

%>
<!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;>
<html>

<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<meta name=&quot;GENERATOR&quot; content=&quot;Microsoft FrontPage 4.0&quot;>
<meta name=&quot;ProgId&quot; content=&quot;FrontPage.Editor.Document&quot;>
<title>Out Today</title>
</head>

<body bgcolor=&quot;#C0C0C0&quot; bgproperties=&quot;fixed&quot;>

<h2 align=&quot;center&quot;>Out Today</h2>
<p align=&quot;center&quot;><b><i><u><span style=&quot;text-transform: uppercase&quot;><font face=&quot;Book Antiqua&quot; color=&quot;#0000FF&quot;>**
Information will be updated each workday by 9 am **</font></span></u></i></b></p>
<hr>
<div align=&quot;center&quot;>
<center>
<table border=&quot;4&quot; bgcolor=&quot;#C0C0C0&quot; bordercolor=&quot;#0000FF&quot; bordercolordark=&quot;#FF0000&quot; bordercolorlight=&quot;#000080&quot;>
<tr>
<th><strong><u>Name</u></strong></th>
<td width=&quot;25&quot;><br>
</td>
<th><strong><u>Remarks</u></strong></th>
<td width=&quot;25&quot;><br>
</td>
</tr>
<strong><%
'Iterate through the recordset, pull
'out the required data, and insert it
'into an HTML table.
Do While Not rsInfo.EOF
%>
</strong>
<tr>
<td><strong><% =rsInfo(&quot;Name&quot;) %></strong></td>
<td align=&quot;center&quot; width=&quot;25&quot;><br>
</td>
<td><strong><% =rsInfo(&quot;Remarks&quot;) %></strong></td>
<td align=&quot;center&quot; width=&quot;25&quot;><br>
</td>
</tr>
<%
'Move to the next record in the
'recordset
rsInfo.MoveNext

Loop

'Close the recordset.
rsInfo.Close

'And close the database connection.
cnnDB.Close
%>
</table>
</center>
</div>
<p align=&quot;center&quot;> </p>
<p align=&quot;center&quot;><font color=&quot;#0000FF&quot;><strong>Page was last updated on</strong></font></p>
<p align=&quot;center&quot;><font color=&quot;#0000FF&quot;><strong><!--webbot bot=&quot;Timestamp&quot;
s-type=&quot;REGENERATED&quot; s-format=&quot;%A, %B %d, %Y&quot; --></strong></font></p>


</body>

</html>


Thanks - Have a great day

< I want to work in Theory - everything and everybody works in Theory !!>
 
A way of doing these two pages is to have a log in page, so you can determine user level. This thenm leads onto a single page containing 2 panels. This page would need to be an asp page. The code would then populate two tables to store all the information for both user types.

Using the invisible attribute of the panels, tyou can then hide one or the other panel, dependant on the user level. Is this the kind of thing you were looking for?

BB
 
BiggerBrother -
The web pages are on Windows 2000 - I do have a Supervisor web page set up with a user and password - I'm looking for a way to put in a JavaScript or a (If Statement) in the Acess 2000 sql that would set the Remarks to &quot;Out&quot; , &quot;AM&quot; , &quot;PM&quot; ,
&quot;V03&quot; or &quot;P03&quot; based on certain critera.
I have tried the IIF statement in Access but that is only on a True , False state.

Thanks



< I want to work in Theory - everything and everybody works in Theory !!>
 
if all remarks are in the format REASON / TIME using a slash to separate, you could use the charat() statement to find where in the returned sql statemnet the / can be found, and then trim the string at this point.

BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top