Note that there are some explanatory texts on larger screens.

plurals
  1. POcfapplication stop bind/Ajax function?
    primarykey
    data
    text
    <p>I am doing ColdFusion with mySQL. I face a problem with bind and autosuggest function. </p> <p>If just run this single file, the autosuggest or bind is working , i can get the result with autosuggest.</p> <pre><code>&lt;cfinput type="text" name="Name" maxlength="100" size="30" required="yes" message="Restaurant name is required!" validateAt="onSubmit, onServer" autosuggest="cfc:Restaurants.LookupRestaurant({cfautosuggestvalue})"&gt; </code></pre> <p>But after i add an application.cfm , start with</p> <pre><code>&lt;cfapplication name="cfcentral" sessionmanagement="true" sessiontimeout="#CreateTimeSpan(0,0,30,0)#" /&gt; &lt;cfset application.dsname="suman"&gt; &lt;cfset request.dsname="suman"&gt; &lt;cfset session.profile=StructNew()&gt; &lt;cfif IsDefined("Form.logout")&gt; &lt;cflogout&gt; &lt;/cfif&gt; &lt;cflogin&gt; &lt;cfif NOT IsDefined("cflogin")&gt; &lt;cfinclude template="loginform.cfm"&gt; &lt;cfabort&gt; </code></pre> <p>Then my problem start happen, the autosuggest or bind have no more function. Some people suggest i addon </p> <pre><code>&lt;cfajaximport tags="cfform"&gt; </code></pre> <p>But it fail to solve the problem.</p> <hr> <p>i found out , if i add a , and remove the code below , the bind is working.</p> <pre><code>&lt;cfoutput query="loginQuery"&gt; &lt;cfform action="#CGI.script_name#?#CGI.query_string#" name="test"&gt; &lt;a href="##"&gt;#First_Name# #Last_Name#&lt;/a&gt; &lt;input type="submit" Name="Logout" value="Logout"&gt; </code></pre> <p>But the code above is important to me. Anyone know the solution can work perfect with the code above ?</p> <hr> <p>This is my original application.cfm</p> <pre><code>&lt;cfapplication name="cfcentral" sessionmanagement="true" sessiontimeout="#CreateTimeSpan(0,0,30,0)#" /&gt; &lt;cfset application.dsname="suman"&gt; &lt;cfset request.dsname="suman"&gt; &lt;cfset session.profile=StructNew()&gt; &lt;cfif IsDefined("Form.logout")&gt; &lt;cflogout&gt; &lt;/cfif&gt; &lt;cflogin&gt; &lt;cfif NOT IsDefined("cflogin")&gt; &lt;cfinclude template="loginform.cfm"&gt; &lt;cfabort&gt; &lt;cfelse&gt; &lt;cfif cflogin.name IS "" OR cflogin.password IS ""&gt; &lt;cfoutput&gt; &lt;h2&gt;You must enter text in both the User Name and Password fields. &lt;/h2&gt; &lt;/cfoutput&gt; &lt;cfinclude template="loginform.cfm"&gt; &lt;cfabort&gt; &lt;cfelse&gt; &lt;cfquery name="loginQuery" dataSource="Reservation"&gt; SELECT * FROM User_Customer WHERE Email = '#cflogin.name#' AND Password = '#cflogin.password#' &lt;/cfquery&gt; &lt;cfif loginQuery.User_Customer_ID NEQ ""&gt; &lt;cfloginuser name="#cflogin.name#" Password = "#cflogin.password#" roles="#loginQuery.User_Customer_ID#"&gt; &lt;cfelse&gt; &lt;cfoutput&gt; &lt;H2&gt;Your login information is not valid.&lt;br&gt; Please Try again&lt;/H2&gt; &lt;/cfoutput&gt; &lt;cfinclude template="loginform.cfm"&gt; &lt;cfabort&gt; &lt;/cfif&gt; &lt;/cfif&gt; &lt;/cfif&gt; &lt;/cflogin&gt; &lt;cfif GetAuthUser() NEQ ""&gt; &lt;cfquery name="loginQuery" dataSource="Reservation"&gt; SELECT * FROM User_Customer WHERE Email = '#GetAuthUser()#' &lt;/cfquery&gt; &lt;cfoutput query="loginQuery"&gt; &lt;cfform action="#CGI.script_name#?#CGI.query_string#" name="test"&gt; &lt;a href="##"&gt;#First_Name# #Last_Name#&lt;/a&gt; &lt;input type="submit" Name="Logout" value="Logout"&gt; &lt;/cfform&gt; &lt;/cfoutput&gt; &lt;/cfif&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload