小编Kon*_*hao的帖子

ColdFusion中的元素未定义错误.cfparam不起作用

我遇到问题,我的ColdFusion代码返回"元素AUTHOR在FORM中未定义".每当我提交表格时 我已经尝试使用<cfparam>设置,comment.author但它也没有用.我对ColdFusion很新,所以任何推理评论都会很棒!

<cfparam name="form.submitted" default="0" />
<cfset blogPost = EntityLoad('BlogPost',url.id,true) />
<cfif form.submitted>
    <cfset comment = EntityNew('BlogComment') />
    <cfset comment.author = form.author />
    <cfset comment.comment = form.comment />
    <cfset comment.createdDateTime = now() />
    <cfset blogPost.addComment(comment) />
    <cfset EntitySave(blogPost) />
</cfif>

<cfimport taglib="customTags/" prefix="layout" />
<layout:page section="blog">    

        <!-- Content Start -->

        <!--Card  -->
        <div id="content">
            <div class="card-pattern">
                <!-- blog -->
                <div id="blog">
                    <div class="clr">
                        <div class="top-bg1">
                            <div class="top-left">
                                <div><h1>Blog</h1></div>
                            </div> 
                        </div>
                        <div class="clr">
                            <div class="pat-bottomleft">&nbsp;</div>
                            <div class="pat-bottomright">&nbsp;</div> …
Run Code Online (Sandbox Code Playgroud)

coldfusion coldfusion-10 cfml cfimport

1
推荐指数
1
解决办法
3989
查看次数

标签 统计

cfimport ×1

cfml ×1

coldfusion ×1

coldfusion-10 ×1