Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
EdmondsM #1
Post a query to the same page
Hi All, I have a search page that has the ability to search for Lastname,
firstname, typeOfAppointment. When I first load the page it displays the input
fields just fine. But it also displays all of the records for each of the
fields. How do I keep all of the records from displaying when the search page
is loaded. I am attaching the code that I am using.
<!-- Here is the code from the CFC -->
<cfcomponent output="false">
<cffunction name="getAll" access="public" returntype="query">
<cfquery datasource="someActions" name="Everyone">
SELECT emp.*, b.ParkName AS ParkName, pa.Description AS Description,
pal.ID AS actionID
FROM tbl_Some emp INNER JOIN
tbl_Park_Action_Link pal ON emp.ID = pal.SomeID INNER
JOIN
tbl_Park b ON emp.ParkID = b.ID INNER JOIN
tbl_Site_Action pa ON pal.SiteActionID = pa.ID
WHERE FName LIKE '%#form.FName#%' and LName LIKE '%#form.LName#%'
ORDER BY LName
</cfquery>
<cfreturn Everyone>
</cffunction>
</cfcomponent>
<!-- This is the code from the search page -->
<cfform action="" method="post">
<cfinput type="text" name="FName">
<cfinput type="text" name="LName">
<cfinput type="submit" name="submit" value="Submit">
</cfform>
<cfparam name="form.Fname" default="">
<cfparam name="form.LName" default="">
<cfinvoke component="Search" method="getAll" returnvariable="Everyone">
<cfoutput query="Everyone">
<table border="0" cellpadding="3" cellspacing="0">
<tr>
<th>Name</th>
<th>Position</th>
</tr>
<tr>
<td>
#LName#, #FName#
</td>
<td>
#Description#
</td>
</tr>
</table>
</cfoutput>
Thanks in advance.
EdmondsM Guest
-
#25793 [Bgs]: special POST or GET query crashes PHP under Windows
ID: 25793 Updated by: sniper@php.net Reported By: valyala at tut dot by Status: Bogus Bug Type: ... -
#25793 [Opn]: special POST or GET query crashes PHP under Windows
ID: 25793 User updated by: valyala at tut dot by Reported By: valyala at tut dot by Status: Open Bug Type: ... -
#25793 [Com]: special POST or GET query crashes PHP under Windows
ID: 25793 Comment by: Stephen at ediassociates dot com Reported By: valyala at tut dot by Status: Open Bug... -
Can a asp page post data to another asp page inside frameset?
I know this is probably easy but here is the details. I have an asp page that is not inside a frameset. I want to post data to another asp page... -
Odd place to post Netscape query
I know this may be an odd place to post a Netscape query but here goes anyway. Got a basic ASP.NET page that references JPGs from an 'images'... -
EdmondsM #2
Re: Post a query to the same page
I answered my own question. Just in case someone else is trying to do this
same thing. Wrap the following code in <cfif isDefinded("form.submit")
<cfform action="" method="post">
<cfinput type="text" name="FName">
<cfinput type="text" name="LName">
<cfinput type="submit" name="submit" value="Submit">
</cfform>
<cfparam name="form.Fname" default="">
<cfparam name="form.LName" default="">
<cfinvoke component="Search" method="getAll" returnvariable="Everyone">
<cfoutput query="Everyone">
<table border="0" cellpadding="3" cellspacing="0">
<tr>
<th>Name</th>
<th>Position</th>
</tr>
<tr>
<td>
#LName#, #FName#
</td>
<td>
#Description#
</td>
</tr>
</table>
</cfoutput>
EdmondsM Guest



Reply With Quote

