dcsimg

Creating Dynamic Forms Page 2

By ServerWatch Staff (Send Email)
Posted Jan 11, 1999


This page is the main page for the insurance company. It contains links to the new transaction page and links to each transaction, done thru DHTML outlines.

The following  javascript is from MSDN. It is used for the DHTML outlines for the Insurance center
<SCRIPT LANGUAGE="JavaScript">
  function clickHandler() {
      var targetId, srcElement, targetElement;
    
      srcElement = window.event.srcElement;
      if (srcElement.className == "Outline") {
           targetId = srcElement.id + "d";
           targetElement = document.all(targetId);
      if (targetElement.style.display == "none") {
          targetElement.style.display = "";
          srcElement.src = "OPEN.gif";
      } else {
          targetElement.style.display = "none";
          srcElement.src = "CLOSED.gif";
      }
}
}

document.onclick = clickHandler;


</SCRIPT>

INSURANCE CENTER:<BR><HR><BR>

'I have begun using file DSN to connect to web databases. It is the way to go if you have to wait
'for an administrator to set up a system DSN
<% Set Count = Server.CreateObject("ADODB.Connection")
DB_PATH = SERVER.MAPPATH("/DB")  'map a path to the Database directory
CONNECT_STR = "FILEDSN="&DB_PATH&"\DB.DSN;" & _
"DBQ=" & DB_PATH & "\WEBDB.MDB;"  


count.Open CONNECT_STR   'open the db connection

'get a recordset of all the transactions
Set RS = Count.Execute("SELECT * FROM TRAN ORDER BY TR_NAME")
%>

<IMG SRC="CLOSED.gif" ID="Out2" CLASS="Outline" STYLE="cursor: hand" WIDTH="16" HEIGHT="16">MAINTENANCE<BR>
<DIV ID="Out2d" STYLE="display:None">
&nbsp;&nbsp;&nbsp;&nbsp;<IMG SRC="CLOSED.gif" WIDTH="20" HEIGHT="15">&nbsp;<a href="NEW_TRAN1.ASP">ADD NEW TRANSACTION</A><BR>
&nbsp;&nbsp;&nbsp;&nbsp;<IMG SRC="CLOSED.gif" WIDTH="20"HEIGHT="15">&nbsp;ADD NEW INSURANCE TYPE<BR>
</DIV>


<DIV ID="Out0">
<IMG SRC="CLOSED.gif" ID="Out<%=DIV_NBR + 1%>" CLASS="Outline" STYLE="cursor: hand" WIDTH="16" HEIGHT="16">&nbsp;TRANSACTIONS<BR>
<DIV ID="Out1d" STYLE="display:None">

<%
'in this loop we are creating a link to each form
DO WHILE NOT RS.EOF
      DIV_NBR = DIV_NBR + 1 %>

&nbsp;&nbsp;&nbsp;&nbsp;---&nbsp;
<a href="TRAN.ASP?TRAN_ID=<%=RS.FIELDS("TR_ID")%>"> <%=RS.FIELDS("TR_NAME")%></a><BR>
<%
RS.MOVENEXT
LOOP %>

</DIV>
</DIV><br>



Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.


 

 


Thanks for your registration, follow us on our social networks to keep up-to-date