- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
首先,我不仅是 SO 的新手,而且我也是任何一种网络编程的新手,所以我是新手,感谢您的帮助和耐心等待!因此,以前对 HTML、ColdFusion、SQL、SQL Server 等的经验为零,所以我在过去两周内学到的任何东西。
我正在尝试在 ColdFusion 中制作 3 个动态相关下拉菜单(三重相关选择),最终会在另一个 .CFM 页面中打开 map 。下拉列表是从 SQL Server 中的一个表中填充的。我已经做了很多研究(关于 SO 和其他地方)并且我有一个主要有效的方法,但它有一个问题,我很乐意帮助找出为什么一件事不起作用。我正在使用 .CFC 查询数据库以获取每个下拉菜单的信息,我试图让每个下拉菜单都依赖于前一个,然后在 .CFM 中我使用“绑定(bind)”。这是我的 CFC 和 CFM 代码:
CFC(名为 GettingData):
<cfcomponent displayname="GetStuff" hint="Getting data on cruises from database">
<!---GET ARRAY OF TRIBUTARIES--->
<cffunction name="getData" access="remote" returntype="query" hint="Get data for first select">
<!---define variables--->
<cfset var data="tributary">
<!---Run the query for tributaries--->
<cfquery name="data" datasource="mydatasource">
SELECT distinct Tributary
FROM df_cruises
ORDER BY Tributary
</cfquery>
<!---and return it--->
<cfreturn data>
</cffunction>
<!---Get DATES by tributary--->
<cffunction name="getDates" access="remote" returntype="query"
hint="Get cruise dates by tributary for select dropdown">
<cfargument name="Tributary" type="any" required="no">
<!---Define variables--->
<cfset var data="CruiseDate">
<!---Run query to get Date Data--->
<cfquery name="data" datasource="mydatasource">
SELECT *, CruiseDate AS date <!---this gets date to display correctly in dropdown--->
FROM df_cruises
WHERE Tributary='#ARGUMENTS.Tributary#'<!---single quotes for SQL Server--->
ORDER BY CruiseDate desc
</cfquery>
<!---And return it--->
<cfreturn data>
</cffunction>
<!---getting the html file based on the cruisedate selection--->
<cffunction name="getmapname" access="remote" returntype="query"
hint="Get html file by tributary and cruisedate for dropdown select">
<cfargument name="Tributary" type="any" required="no">
<cfargument name="mapfile" type="any" required="no">
<!---Define variables--->
<cfset var data="">
<cfset var data="">
<!---Get file html Data--->
<cfquery name="data" datasource="mydatasource">
SELECT CruiseDate, Tributary, File_html
FROM df_cruises
WHERE CruiseDate='#ARGUMENTS.mapfile#'AND Tributary='#ARGUMENTS.Tributary#'AND File_html<>'notsampled'
</cfquery>
<!---And return it--->
<cfreturn data>
</cffunction>
</cfcomponent>
CFM(名为 DropdownDisplay):
<cfparam name="url.File_html" default = '2'>
<cfform name="CruiseChoose" action="mapdisplayv3.cfm" method="post">
<table align="center" bgcolor="orange">
<tr>
<th colspan="2">
<font size="+1">First Select a Water Body, Then Choose Cruise Date</font>
</th>
</tr>
<tr>
<td>
<br/>
Tributary/Water Body:<br />
<cfselect name="Tributary"
bind="cfc:GettingData.getData()"
display="Tributary"
value="Tributary"
bindonload="true"
multiple="no"
size="6" />
</td>
<td>
<br />
Cruise Dates:<br />
<cfselect name="CruiseDate"
bind="cfc:GettingData.getDates({Tributary})"
bindonload="false"
type="link"
display="date"
value="CruiseDate"
multiple="no"
size="6"/>
</td>
<td>
<br>
Map Links:<br />
<cfselect name="link"
bind="cfc:GettingData.getmapname({CruiseDate},{Tributary})"
bindonload="false"
type="any"
display="File_html"
value="File_html"
multiple="no"
size="3"/>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<br />
</form>
<!--- submit button --->
<cfoutput> <input type="submit" name="submit" value="View Selected Maps" alt="View Map Selection Button"><br></cfoutput>
<!--- Reset button. --->
<input name="reset" type="reset" value="Clear Selections" alt="Clear Selections Button">
</td>
</tr>
</table>
</cfform>
</html>
The first dropdown is pulling a list of tributaries, and when a ‘Tributary’ is chosen the second dropdown correctly populates the list of ‘CruiseDates’ when they were sampled.第三个下拉菜单应该填充表格中的“File_html”,该表格成为打开另一个 CFM 上数据图像映射的链接。 (这不是我的最终目标,这是我一步步实现的目标。)
The issue I am having is that the third dropdown does not seem to be holding the dependency to the first dropdown selection (Tributary), so when a CruiseDate is selected where 2 tributaries happened to be sampled on the same date both of those File_html 名称显示在第三个下拉列表中(屏幕截图):在 CFC 中,在“getmapname”函数中,我尝试使用 2 个参数(我在网上看到的某个地方使用过)以便我可以重用该参数(连同 cfargument name="mapfile"),以便在最后一个查询中我可以执行以下操作:
<cfquery name="data" datasource="mydatasource">
SELECT CruiseDate, Tributary, File_html
FROM df_cruises
WHERE CruiseDate='#ARGUMENTS.mapfile#' AND Tributary='#ARGUMENTS.Tributary#'
AND File_html<>'notsampled'
</cfquery>
这没有用。当我有 2 个参数时出现错误,它似乎只允许 1 个。
这是第三个下拉列表的屏幕截图,显示虽然选择了“Back River”,但它正在拉取在同一日期采样的 2 个支流的 File_html:
我也开始研究一个 javascript 版本,但我也坚持使用它,因为这已经很接近了,所以我一直在研究这个方法。但是,如果无法使用此方法进行三重相关选择,我将不得不继续!
任何帮助都会非常好,谢谢! -B(很抱歉发了这么长的帖子,只是想说的很透彻)
最佳答案
感谢大家的帮助和耐心,我得到了 2 个参数,第三个下拉菜单现在只返回它应该返回的数据(即,它正确地绑定(bind)到第一个和第二个下拉菜单中的选择)。谢谢你!这是有效的新代码:
氟氯化碳:
<cfcomponent displayname="GetStuff" hint="Getting data on cruises from database">
<!---GET ARRAY OF TRIBUTARIES--->
<cffunction name="getData" access="remote" returntype="query" hint="Get data for first select">
<!---define variables--->
<cfset var data="tributary">
<!---Run the query for tributaries--->
<cfquery name="data" datasource="mydatasource">
SELECT distinct Tributary
FROM df_cruises
ORDER BY Tributary
</cfquery>
<!---and return it--->
<cfreturn data>
</cffunction>
<!---Get DATES by tributary--->
<cffunction name="getDates" access="remote" returntype="query" >
<cfargument name="Tributary" type="any" required="no">
<!---Define variables--->
<cfset var data="CruiseDate">
<!---Run query to get Date Data--->
<cfquery name="data" datasource="mydatasource">
SELECT *, CruiseDate AS date
FROM df_cruises
WHERE Tributary=
<cfqueryparam cfsqltype='cf_sql_varchar' value='#ARGUMENTS.Tributary#'>
ORDER BY CruiseDate desc
</cfquery>
<!---And return it--->
<cfreturn data>
</cffunction>
<!---getting the html file based on the CruiseDate selection--->
<cffunction name="getmapname" access="remote" returntype="query" >
<cfargument name="mapfile" type="any" required="no" default="">
<cfargument name="Tributary" type="any" required="no" default="">
<!---Define variables--->
<cfset var data="">
<!---Get file html Data--->
<cfquery name="data" datasource="mydatasource">
SELECT CruiseDate, Tributary, File_html
FROM df_cruises
WHERE CruiseDate=<cfqueryparam cfsqltype='cf_sql_date' value='#ARGUMENTS.mapfile#'> AND Tributary=<cfqueryparam cfsqltype='cf_sql_varchar' value='#ARGUMENTS.Tributary#'> AND File_html<><cfqueryparam cfsqltype="cf_sql_varchar" value='notsampled'>
</cfquery>
<!---And return it--->
<cfreturn data>
</cffunction>
</cfcomponent>
CFM:
<cfparam name="url.File_html" default = '2'>
<cfform name="CruiseChoose" action="mapdisplayv3.cfm" method="post">
<table align="center" bgcolor="orange">
<tr>
<th colspan="2">
<font size="+1">First Select a Water Body, Then Choose Cruise Date</font>
</th>
</tr>
<tr>
<td>
<br />
Tributary/Water Body:<br />
<cfselect name="Tributary"
bind="cfc:GettingData.getData()"
display="Tributary"
value="Tributary"
bindonload="true"
multiple="no"
size="6" />
</td>
<td>
<br />
Cruise Dates:<br />
<cfselect name="CruiseDate"
bind="cfc:GettingData.getDates({Tributary})"
bindonload="false"
type="link"
display="date"
value="CruiseDate"
multiple="no"
size="6"/>
</td>
<td>
<br>
Map Links:<br />
<cfselect name="link"
bind="cfc:GettingData.getmapname({CruiseDate}, {Tributary})"
bindonload="false"
type="any"
display="File_html"
value="File_html"
multiple="no"
size="3"/>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<br />
</form>
<!--- submit button --->
<cfoutput> <input type="submit" name="submit" value="View Selected Maps" alt="View Map Selection Button"><br></cfoutput>
<!--- Reset button. --->
<input name="reset" type="reset" value="Clear Selections" alt="Clear Selections Button">
</td>
</tr>
</table>
</cfform>
</html>
关于drop-down-menu - ColdFusion 中的动态依赖/三重相关选择,第三个不持有第一个选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36893740/
我正在使用 gfx-hal,这需要我创建需要使用特定于其类型的函数显式销毁的资源。我想将这些类型的实例存储在结构中,并且我还想将清理它们与拥有结构的生命周期相关联,而不是手动管理它们的生命周期并可能在
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 7 年前。 Improve
我知道这一定是非常明显的事情,但我不明白。我有两个 div,一个可拖动,另一个带有 on:drop,当我将可拖动的 div 放到它上面时,它似乎没有被调用。我错过了什么? 回复:https://sve
在下面的应用程序中,从未调用 drop 方法。放置目标 ( div2 ) 由 dragEnter 和 dragOver 事件中的取消事件指示,但不触发放置。 HTML 和 .dart 如下:
我已经使用 ng2 文件上传实现了文件删除。我面临的问题是,当文件被拖放到拖放区域之外时,浏览器会打开它。有什么办法可以防止这种事件发生吗? Angular 2/4 最佳答案 是的,终于成功了。我希望
我是使用rust 的新手。我的简单代码 struct Foo{ data : & 'a String, } fn test_foo(){ let s1:String = String::
我希望 image.src 显示 id,而不是每个 的值。 drop.id 存在吗?这可以做到吗?或者id被锁定在中?当用户点击提交时,我需要传递表单中的值。 function swapImage
我正在使用一个数据框,我必须将两列(定量和销售)添加然后删除它们,然后将列名称的第一个字母大写。问题是当我使用 drop 时,它会将其保存到另一个数据帧。从文档来看,问题来自 inplace=fals
我想让 Drop left 而不是在 bootstrap 下拉按钮中下拉。我正在努力实现这一点,但我无法做到这一点,有人可以指导我这样做吗? 这是我的代码 Small button
我在使用 Blazor 时遇到了一个奇怪的问题... 我有一个使用拖放功能的应用程序,它使用 .Net Core 3.1 运行良好。然而,无论我做什么,drop 事件现在都不会被解雇,我不知道为什么。
我希望能够移动(在灰色背景上,通过拖放)Bootstrap 2 提供的模态表单。谁能告诉我实现此目的的最佳实践是什么? 最佳答案 默认情况下, Bootstrap 不附带任何拖放功能,但您可以添加一些
我试图在拖放过程中更改节点上的光标,但图像没有改变。我打电话 setCursor()在 DragDetectedEventHandler我的节点。我也试过调用 getParent().setCurso
我刚刚注意到您可以在 PostgreSQL 中编写两者。有什么区别还是只是“简化”的语法。据我所知,这两者的作用完全相同。 ALTER TABLE table DROP my_column; 对比 A
我将屏幕分为两个 DIV。在左侧的 DIV 中,我有一些 50x50 像素的 DIV,在右侧的 DIV 中,我有一个由 80x80 LI 组成的空网格 。左侧的 DIV 是可拖动的,一旦放到 LI 上
我正在使用这个库 Drop ,但是记录很差,我不明白如何使用它。首先我安装了: npm install tether-drop 我已经下载了 Drop.js,然后用 Tether 导入它(导入所有内容
我想使用 jQuery 处理拖放 HTML 5 功能。直到没有触发 drop 事件为止都可以。看看我的代码: A B C $('#columns .column').on({
我需要使用 mysqldump 和 replace 而不是 insert 并且在恢复时不删除数据库和表。但我需要删除并重新创建触发器和存储过程 为此,我将 mysqldump 与 --replace
在 CD 管道中,我使用下载构建工件任务将工件下载到目标目录。我的发布工件目录结构如下 drop --> 来源 --> abc.zip 现在的问题是,每当我下载工件时,它都会下载整个放置文件夹并将相同
您好,我正在开发拖放应用程序。我有一个可以沿着文档拖动的 DIV,并且文档中还有其他一些 div,我可以将一个 div 拖到其他 div,这会使页面变得困惑它在空的地方并禁用另一个 div 中的放置,
我有以下代码: $(".dropzone").on("dragover", function(ev) { ev.preventDefault();
我是一名优秀的程序员,十分优秀!