|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ASP in Dreamweaver Layers
Hi All
I have an access database in which the main form hold some 30 fields so I have used a tabbed interface to simply break the fields down over the tabs so the page does not look cluttered. The next stage is to transfer the database to the web, I intend to use dreamweaver to carry out my coding. In the past I created a static dreamweaver tabbed interface using layers. Where I have say five layers all stacked on top of each other. I then have a button interface, which upon the click of certain buttons simply shows the relevant layers and hides the ones connected to the disabled buttons. This has worked fine with regards to static html text Would it be possible for each layer to hold a few of few the datrabase fields coded in asp and the others hold other information relevent to that layer tab. Ie can I break the code down over layers rather than pages Hope someone can help Thanks Jamie on |
|
#2
|
||||
|
||||
|
I would stronly recommend against using Dreamweaver for any type of coded application.
Generally, the code it creates is bloated, unnecessary and bug ridden. |
|
#3
|
||||
|
||||
|
...Coming from an advocate of MS products
![]() Seriously though So long as you code the ASP and ADO code yourself there shouldn't be any problem But if possible, code the positioned <divs> by hand, DW has the habit of messing up semantic code like there's no tomorrow (of course, not as bad as say... FrontPage or NetObjectsFusion) Try this: Code:
<%
Dim rsRecordSet, strSQL, strConn
strConn = "" ' Your connection string, be it a DSN name or whatever
strSQL = "SELECT " & Your fields for tab 1 & " FROM tblWhatever WHERE field = 'condition' ORDER BY field DESC "
Set rsRecordSet = Server.CreateObject("ADODB.Recordset")
With rsRecordSet
.ActiveConnection = strConn
.Source = strSQL
.Open
End With
%>
<div id="Container"> <!-- Container for your "form" -->
<div class="Tab">
<table>
<tr>
<td>ColOne</td>
<td>ColTwo</td>
<td>Etc...</td>
</tr>
<% Do While Not rsRecordSet.EOF = True %>
<tr>
<td>ColOne</td>
<td>ColTwo</td>
<td>Etc...</td>
</tr>
<% rsRecordSet.MoveNext
Loop%>
</table>
</div>
<% rsRecordSet.Close
strSQL = "SELECT " & Your fields for tab 2 & " FROM tblWhatever WHERE field = 'condition' ORDER BY field DESC "
rsRecordSet.Source = strSQL
rsRecordSet.Open%>
<div class="Tab">
<table>
<tr>
<td>ColOne</td>
<td>ColTwo</td>
<td>Etc...</td>
</tr>
<% Do While Not rsRecordSet.EOF = True %>
<tr>
<td>ColOne</td>
<td>ColTwo</td>
<td>Etc...</td>
</tr>
<% rsRecordSet.MoveNext
Loop%>
</table>
</div>
</div>
<!-- And so on for each tab, then add the rsRecordSet.Close() method and Set = Nothing as well -->
Oh, and use CSS to set tabs 2 through whatever to invisible, or just z-indexing, but visibility would be eaiser with JavaScript later on... Code:
#Tab1 {
display: visible;
}
#Tab2 {
display: hidden;
}
#Tab3 {
display: hidden;
}
Etc....
And the JS Add the "onClick" attribute to any <a> or <li> or <button> you wish Code:
function showhide(layer_ref) {
if (state == 'visible') {
state = 'hidden';
} else {
state = 'visible';
}
if (document.all) {
eval( "document.all." + layer_ref + ".style.visibility = state");
}
if (document.getElementById && !document.all) {
maxwell_smart = document.getElementById(layer_ref);
maxwell_smart.style.visibility = state;
}
You will need to modify that code slightly (I copied it from a previous work of mine) to get it to work as you wish HTH -1337_d00d |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > ASP in Dreamweaver Layers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|