CFC绑定在Firefox中不起作用

时间:2014-07-07 18:40:03

标签: firefox coldfusion cfc

我的应用程序中有一个表单,其中包含三个输入字段,这些字段具有从CFC中的查询填充的值。

第一个字段是通过CFC调用返回的CFSELECT值列表。选择一个值后,另外两个CFINPUT字段将通过对同一CFC的BIND调用进行相应更新。很直接。

一切都按计划在Google Chrome和Safari中运行,但在Firefox中则不然。在Firefox中,我的CFSELECT列表为空,因此我的其他2个CFINPUT字段中没有任何值包含任何值。

我还没有在IE中试过,但是对于我们正在创建的这个应用程序,浏览器不是计划支持的broswer。但是之前我从来没有像Firefox这样的不相容,只是用IE浏览器。

我有什么遗失的吗?

这是我的表格

<cfform name="addmileage" id="addmileage" method="post" class="vehicle-log-form">
             <br />
<table border="0" cellpadding="5">
                      <tr>
                        <td><label class="vehicle-log-form">Service Vehicle:</label></td>
                        <td><cfselect class="vehicle-log-form" queryPosition="below" name="vehicle_name" id="vehicle_name" value="vehicle_name" bind="cfc:cfcs.mileagedata.getData()" bindonload="true" >
                        </cfselect>                    </td>
                      </tr>
                      <tr>
                        <td><label class="vehicle-log-form">Date:</label></td>
                        <td><cfinput class="tripCalendarInputBox" name="vdate" id="vdate" type="text" required="yes" /></td>
                      </tr>
                      <tr>
                        <td>
                          <label class="vehicle-log-form">Origin:</label></td>
                        <td><cfinput class="vehicle-log-form" required="yes" name="origin" type="text" /></td>
                      </tr>
                      <tr>
                        <td><label class="vehicle-log-form">Destination:</label></td>
                        <td><cfinput required="yes"  class="vehicle-log-form" name="destination" type="text" /></td>
                      </tr>
                      <tr><!---onBlur="stopMaterialCalc();" onFocus="startOdometerCalc();" bind="cfc:cfcs.mileagedata.getDetail({vehicle_name})" bindattribute="value" bindonload="true" ---> 
                        <td><label class="vehicle-log-form">Start Odometer:</label></td>
                        <td><cfinput class="vehicle-log-form" id="start_odometer"  name="start_odometer" type="text"  onBlur="stopMaterialCalc();" onFocus="startOdometerCalc();" bind="cfc:cfcs.mileagedata.getDetail({vehicle_name})" bindattribute="value" bindonload="true"/></td>
                      </tr>
                      <tr><!---onBlur="stopMaterialCalc();" onFocus="startOdometerCalc();" bind="cfc:cfcs.mileagedata.getDetail({vehicle_name})" bindattribute="value" bindonload="true" --->
                        <td><label class="vehicle-log-form">End Odometer:</label></td>
                        <td><cfinput class="vehicle-log-form"  id="end_odometer" name="end_odometer" type="text"  onBlur="stopMaterialCalc();" onFocus="startOdometerCalc();" bind="cfc:cfcs.mileagedata.getDetail({vehicle_name})" bindattribute="value" bindonload="true"/></td>
                      </tr>
                      <tr>
                        <td><label class="vehicle-log-form">Total mileage:</label></td>
                        <td><cfinput class="vehicle-log-form" id="total_mileage" name="total_mileage" type="text" /></td>
                      </tr>
                      <tr>
                        <td><label class="vehicle-log-form">Expenses:</label></td>
                        <td><cfinput class="vehicle-log-form" value="0.00" name="expenses" type="text" /></td>
                      </tr>
                      <tr>
                        <td colspan="2">

                       <cfinput class="vehicle-log-form" type="submit" id="submit" name="submit" value="Add Trip">
                                         <br /><cfform>

这是我的CFC

  <!---Service Vehicle Slect Box --->
<cffunction name="getData" access="remote" returntype="query">
    <cfoutput>
    <!--- Function to get data from datasource --->
    <!---Get Service Vehicles --->
    <cfquery name="data" datasource="#datasource#">
    select vehicle_name
    from vehicles
    where active = '1'
    </cfquery>
    </cfoutput>

    <!--- Return results --->
    <cfreturn data>
</cffunction>

<cffunction name="getDetail" access="remote" returnType="string">
    <cfargument name="vehicle_name" type="any" required="true">

    <!--- localize function variables --->
    <cfset var dataDetail = "">
    <cfoutput>
    <cfquery name="dataDetail" datasource="#datasource#">
        SELECT mileage
        FROM   vehicles
        <!--- adjust cfsqltype if needed --->
        WHERE vehicle_name = <cfqueryparam value="#ARGUMENTS.vehicle_name#" cfsqltype="cf_sql_varchar">
    </cfquery>
    </cfoutput>
    <cfreturn dataDetail.mileage>
</cffunction></cfcomponent>

0 个答案:

没有答案