Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
sweetyp2005 #1
attach check box with database query result
When I create table to show result of a database query, I want to have a check
box in front of each row. And When user select check box then save those rows
in one files. Is that possible? If so how can I do it?
sweetyp2005 Guest
-
Format query result.
Hi ppl, Im having the time of my life with this database *sigh* Anyways, i have this problem which I can't solve. I would like to format the... -
displaying query result of 0 as N/A
Hi I thought I could do this with an IsDefined function but I can't get it it to work. When I query my data I want to display a value of 0... -
How to deal with big query result?
Greetings, In my search application, user can type a number to search. I use LIKE in my query. If a query result generates over 10,000... -
attach database
hi, i have installed db2 udb v8.1 with fixpack 2 on my machine, then there is another machine installed same kind of server, so i am able to... -
how to add another column to a query result?
hi guys, I have a query that will return 4 record with 1 column. I want to add another "title" column for the four record. The query is design so... -
jdeline #2
Re: attach check box with database query result
The action page (the one that is processed when a user clicks the submit
button) will contain the value of each check box if it has been checked. Save
this value in a database table. See sample code below, where the value "hello"
is stored into the database field "foo" if the checkbox is checked. Otherwise,
a null value is stored.
<!--- form with checkbox --->
<FORM ACTION="results.cfm" ... >
<INPUT TYPE="checkbox" NAME="foo" VALUE="hello">
<INPUT TYPE="submit">
</FORM>
<!--- this is results.cfm --->
<CFPARAM NAME="foo" DEFAULT="">
<CFQUERY NAME="bar" ... >
INSERT INTO myTable (foo) VALUES ('#foo#')
</QUERY>
jdeline Guest
-
jjsand28 #3
Re: attach check box with database query result
This would be easier accomplished (once you get over the learnign curve) by
structures. Then you could save the whole structure to a text file or whereever
you are saving it.
[url]http://tutorial171.easycfm.com/[/url]
jjsand28 Guest
-
coderWil #4
Re: attach check box with database query result
How do you have the database table created. 1 row per result? (comma dilemited
list of saved results?) or 1 row per saved result (as many rows created as
checked results from form.
The former will require 1 query insert, the latter will require 1 query insert
inside of a cfloop (<cfloop list="#form.foo#" index="thisresult"><insert
statement></cfloop>
sample checkbox code (checkboxes give comma dilemited results for multiple
checks on checkboxes with the same name) If all checkboxes are unchecked, then
the result page won't even have the variable name (error checking needed here))
<cfloop query="queryname">
<input type="checkbox" name="foo" value="distinctvalue of query row">
some text to describe the row results<br>
</cfloop>
coderWil Guest



Reply With Quote

