我正在尝试研究ColdFusion(刚刚开始)并在进行一些测试时卡住了.
基本上,我试图将数据从form.cfm传递到storage.cfm.但是,数据似乎没有通过/发送.
这是form.cfm(请忽略标记,这仅用于测试,我是CF的新手,所以你可能会看到一些可怕的东西:D)
<cfparam name="userId" default=0/>
<cfparam name="firstName" default=""/>
<cfparam name="lastName" default=""/>
<cfparam name="address" default=""/>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Learning CF</title>
<meta charset="UTF-8">
</head>
<body>
<h2>Persons Table - <cfif userId EQ 0>Add<cfelse>Edit</cfif></h2>
<form action="storage.cfm" method="POST">
<input type="hidden" name="userId" value="#userId#">
<cfdump var="#userId#"/>
<br/><br/>
<label>First Name:</label>
<input type="text" name="firstName" value="<cfoutput>#firstName#</cfoutput>"><br/><br/>
<label>Last Name:</label>
<input type="text" name="lastName" value="<cfoutput>#lastName#</cfoutput>"><br/><br/>
<label>Address:</label>
<input type="text" name="address" value="<cfoutput>#address#</cfoutput>"><br/><br/>
<input type="submit" value="Submit">
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
这里的cfdump告诉我userId是0.这是storage.cfm
<cfparam name="form.userId" default=""/>
<cfdump var="#form.userId#"/>
Run Code Online (Sandbox Code Playgroud)
当我点击提交时,只显示storage.cfm中显示的内容
#用户身份#
我想尝试分钟下拉.我怎么把它作为01, 02, 03, 04, 05, 06, 07 08, 09, 10, 11, 12等出来?现在前9个数字只出现了1, 2, 3, 4, 5, 6, 7, 8, 9.
<select id="minutes">
<cfloop from="1" to="60" index="m">
<option>#m#</option>
</cfloop>
</select>
Run Code Online (Sandbox Code Playgroud)
好吧,我理解为什么它正在做它正在做的事情并且无论如何都在期待它.哈哈.只是想知道是否有办法让0出现而无需手动创建01-09选项.