0

I know how to manually create an iframe by linking each image to a name.

<a href="0604-013037 - Financial Aid.png" target="viewframe">3501 Nebraska Ave. NW</a>

<iframe name="viewframe" style="display:block;height:1000px;width:1000px"></iframe>

Then using ColdFusion I can also create a table of data.

Number    Name    State

What I want to know, if there is a way to link a query with an iFrame? So that each piece of data is linked with an image that would appear in the iFrame. So that when you select the information from the table an image would appear.

<cfquery datasource="AccessTest" name="qTest">
    SELECT Name, State, Number
    FROM List       
</cfquery>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>
        Displaying a Query in a table
    </title>
</head>

    <div id="content">
        <h1>
            Displaying a Query in a Table
        </h1>
        <table width="600" border="1" cellspacing="0">
        <tr>
            <td><b>Number</b></td>
            <td><b><!---Bolds --->Name</b></td>
            <td><b>State</b></td>
        </tr>
        <cfoutput query="qTest">
            <tr>
                <td>#qTest.Number#</td>
                <td>#qTest.Name#</td>
                <td>#qTest.State#</td>
            </tr>
        </cfoutput>
        </table>
    </div>
4

2 に答える 2

1

これを変更すると:

<a href="0604-013037 - Financial Aid.png" target="viewframe">3501 Nebraska Ave. NW</a>

このようなものに:

<cfoutput query="yourquery">
<a href="IFramePage.cfm?IDToProcess=#IdFromYourQuery#" target="viewframe">
#text from your query#
</a>
</cfquery>

あなたは良いスタートを切っています。ページ IFramePage.cfm には、次のようなコードがあります。

<cfif StructKeyExists(url, "IDToProcess")>
code to get and display data 
<cfelse>
Maybe leave it blank, maybe display something
</cfif>
于 2013-11-25T22:43:00.653 に答える