目前我有代碼,做3件事情。將評論與圖片鏈接
- 它的圖像鏈接到使用iframe
- 它添加註釋
- 它顯示了評論的能力的可點擊的話。
我想要做的,如果可能的是讓顯示的評論與正在顯示的圖片綁定。然後當任何人提交評論時,它將被添加到與圖片關聯的評論的特定列表中。這可能嗎?
簡而言之,有一種方法可以將訪問表與另一個表中的一個特定條目鏈接起來。
這是我到目前爲止。
<cfquery datasource="AccessTest" name="qTest">
SELECT Account, Image
FROM ElectricList
</cfquery>
<cfquery datasource="AccessTest" name="qTest2">
SELECT Account, Image
FROM GasList
</cfquery>
<cfquery datasource="AccessTest" name="qTest3">
SELECT Accounts, Remarks, Users
FROM Comments
</cfquery>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Demo</title>
</head>
<body>
<h3>Demo</h3>
<iframe name="viewframe" style="display:block;height:Float;width:965px;float:left">
</iframe>
<cflayout name="myAccordionLayout" type="accordion" width="600px">
<cflayoutarea title="Electric Accounts" align="left">
<cfoutput query="qTest">
<tr>
<td>
<a href=#qTest.Image#" target="viewframe">#qTest.Account#</a>
</td>
</tr>
</cfoutput>
</cflayoutarea>
<cflayoutarea title="Gas Accounts">
<cfoutput query="qTest2">
<tr>
<td>
<a href=#qTest2.Image#" target="viewframe">#qTest2.Account#</a>
</td>
</tr>
</cfoutput>
</cflayoutarea>
</cflayout>
<table width="600" border="1" cellspacing="0">
<cfoutput query="qTest3">
<tr>
<td>
#qTest3.Accounts#
#qTest3.Remarks#
#qTest3.Users#
</td>
</tr>
</cfoutput>
<cfform name="insertComments" id="insertComments">
<fieldset>
<p>
<label for="Accounts">Accounts</label>
<br/>
<cfinput type="text" name="Accounts" message="Please enter a Comment Title." validateat="onSubmit" required="yes" id="Accounts" size="60">
</p>
<p>
<label for="Remarks">Remarks<br/></label>
<cftextarea name="Remarks" cols="55" rows="4" label="Tour Description" required="yes" validateat="OnSubmit" message="Please enter your comment here" enabled="no">
</cftextarea>
</p>
<p>
<label for="Users">Submitters Name</label>
<br/>
<cfinput type="text" name="Users" message="Please enter your name here." validateat="onSubmit" required="yes" id="Name" size="10" maxlength="60">
</p>
<p>
<cfinput type="submit" name="insertComments" value="Insert Comments" id="submit">
</p>
</fieldset>
</cfform>
<cfif IsDefined("form.InsertComments")>
<cfquery datasource="AccessTest">
INSERT INTO Comments (Accounts, Remarks, Users)
VALUES ('#form.Accounts#','#form.Remarks#','#form.Users#')
</cfquery>
</cfif>
</body>
</html>
我將如何創建子窗體 –
添加鏈接子窗體嚮導 –