Re: Create CSV and TAB docs

2011-11-07 Thread Torrent Girl

Modify http://cflib.org/udf/QueryToCSV2 to use  or chr(9) (a tab 
literal) as the list delimiter.

Alternately, add delimiter as an additional argument, then you can use 
it for both CSV and TAB.

Cheers,
.jonah



Thank Jonah

I am using this one:

http://cflib.org/udf/QueryToCSV2

So you are saying if I change this: var endOfLine = chr(13)  chr(10); to this
var endOfLine = chr(9)  chr(10);

it will work?

I need to change the file ext to .txt right?

Anything else? There are references to CSV in the script. Do I change that to 
tab?


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348492
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Output columns from a query that have been formatted as 2 words

2011-11-07 Thread Torrent Girl

In your original query give the column an alias like

SELECT [First Name] AS FirstName ...

then in your QoQ use the alias (FirstName) to refer to the column.

Azadi




The original is a stored proc. It retrieves the column names as two words 
because those are the column names used to create excel, tab and csv files, so 
I can't change that.

So how do I select a column name with 2 words in a QoQ?

What i want to do is this:

cfquery name=formattedData dbtype=query
Select First Name from query1
/cfquery

But of course this throws an error. 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348493
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Dynamic query help.

2011-11-07 Thread Ray Meade

Thanks Justin, I wasn't aware that a dynamic query was lost once the page was 
finished loading. Does the same rule apply to structures? Perhaps I can use a 
structure to hold the data and update it as changes are made. Basically, I 
don't want the physical database being updated until the submit button is 
clicked, but the client needs to know the new totals as they make changes, so 
that their customer can approve the changes before the client submits them to 
the physical database. 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348494
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Dynamic query help.

2011-11-07 Thread Russ Michaels

normal variables only exists for the duration of the CF request.
you need to use session scope if you want persistence that is specific
to each user.

On Mon, Nov 7, 2011 at 6:01 PM, Ray Meade raym...@yahoo.com wrote:

 Thanks Justin, I wasn't aware that a dynamic query was lost once the page was 
 finished loading. Does the same rule apply to structures? Perhaps I can use a 
 structure to hold the data and update it as changes are made. Basically, I 
 don't want the physical database being updated until the submit button is 
 clicked, but the client needs to know the new totals as they make changes, so 
 that their customer can approve the changes before the client submits them to 
 the physical database.

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348495
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Output columns from a query that have been formatted as 2 words

2011-11-07 Thread Russ Michaels

in SQL you would use square brackets
e.g.
select [first name]

does this not work in QofQ ?

if not, then remember a query is just a struct of associative arrays,
so you can simply reference the columns as struct keys

e.g.
myquery[first name][row]

where row is the row number

or it may be the other way round, I forget

myquery[row][first name]

--

Russ Michaels

www.bluethunderinternet.com  : Business hosting services  solutions
www.cfmldeveloper.com    : ColdFusion developer community
www.michaels.me.uk   : my blog
www.cfsearch.com : ColdFusion search engine

sky

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348496
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Disable submit button after CFFORM validation?

2011-11-07 Thread John Pullam

I can disable a submit button using javascript 
(onclick=this.disabled=true;return true) but this occurs before the 
ColdFusion input field validation.

The problem is that if the form does not pass validation, you cannot resubmit 
it after the errors are corrected because the submit button is disabled.

Can anyone suggest a technique for disabling the button after the form has 
passed validation? (The server code that runs after gets into trouble when 
impatient users do multiple clicks.) 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348497
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Output columns from a query that have been formatted as 2 words

2011-11-07 Thread Leigh

 What i want to do is this:

AFAIK, you cannot.  Check the previous responses. I posted an alternative.

 
-Leig

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348498
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Output columns from a query that have been formatted as 2 words

2011-11-07 Thread Torrent Girl

in SQL you would use square brackets
e.g.
select [first name]

does this not work in QofQ ?

if not, then remember a query is just a struct of associative arrays,
so you can simply reference the columns as struct keys

e.g.
myquery[first name][row]

where row is the row number

or it may be the other way round, I forget

myquery[row][first name]

--

Russ Michaels

www.bluethunderinternet.com  : Business hosting services  solutions
www.cfmldeveloper.com    : ColdFusion developer community
www.michaels.me.uk   : my blog
www.cfsearch.com : ColdFusion search engine

sky

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348499
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Output columns from a query that have been formatted as 2 words

2011-11-07 Thread Torrent Girl

in SQL you would use square brackets
e.g.
select [first name]

does this not work in QofQ ?

if not, then remember a query is just a struct of associative arrays,
so you can simply reference the columns as struct keys

e.g.
myquery[first name][row]

where row is the row number

or it may be the other way round, I forget


Russ that worked when I output the values but not in the QoQ

#dataDownload[First Name][dataDownload.currentRow]#


myquery[row][first name]

--

Russ Michaels

www.bluethunderinternet.com  : Business hosting services  solutions
www.cfmldeveloper.com    : ColdFusion developer community
www.michaels.me.uk   : my blog
www.cfsearch.com : ColdFusion search engine

sky

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348500
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Output columns from a query that have been formatted as 2 words

2011-11-07 Thread Torrent Girl

 What i want to do is this:

AFAIK, you cannot.  Check the previous responses. I posted an alternative.

 
-Leig

Leigh, I am sorry I did not understand what you meant:

cfset queryAddColumn(myQuery, BetterColumnName, myQuery[Awful * Column ! 
Name]) /  

Add a new column to the QoQ?



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348501
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Dynamic query help.

2011-11-07 Thread Justin Scott

 Thanks Justin, I wasn't aware that a dynamic query was lost
 once the page was finished loading. Does the same rule apply
 to structures?

Yes, that would apply to all variables unless you store them in
persistent memory (e.g. database, session scope, write to a file,
etc.).  In your case I would use a separate table in the database to
store their pending order while it's in progress (you could also store
that query object in the session scope if enabled).  You can then use
AJAX calls from the HTML page when things change to call a ColdFusion
template (or CFC method) to update their cart table before
finalizing it as an order.  ColdFusion can return the updated
information via JSON (among other formats) and JavaScript in the HTML
can take that and update the HTML display accordingly.  Once the order
is finalized (i.e. they click submit) then it would post to a
ColdFusion page which makes any final adjustments to the cart,
finalizes the order, and removes the temporary cart table entries.
This can also be good for tracking abandoned checkouts since the data
is persistent.


-Justin

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348502
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Output columns from a query that have been formatted as 2 words

2011-11-07 Thread Torrent Girl

 What i want to do is this:

AFAIK, you cannot.  Check the previous responses. I posted an alternative.

 
-Leig

Leigh I tried your suggestion and it outputs the value of the column:

cfset queryAddColumn(dataDownload, name, dataDownload[First Name]) /  

Here is what I need to do.

The date column in not displaying properly in my file so I need to format it. 
Because the date column is two words: 'DATE COMPLETED', it breaks in my QoQ, 
how do I select the date column in my QoQ so it won't break?

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348503
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Disable submit button after CFFORM validation?

2011-11-07 Thread Steve Milburn

Sounds like you are using CFForm.  I haven't used CFForm for years, but I
seem to recall a submitonce validation parameter when using cfinput
type='submit' /.  Maybe check into that.

HTH.
Steve



On Mon, Nov 7, 2011 at 1:36 PM, John Pullam jpul...@mcleansystems.comwrote:


 I can disable a submit button using javascript
 (onclick=this.disabled=true;return true) but this occurs before the
 ColdFusion input field validation.

 The problem is that if the form does not pass validation, you cannot
 resubmit it after the errors are corrected because the submit button is
 disabled.

 Can anyone suggest a technique for disabling the button after the form has
 passed validation? (The server code that runs after gets into trouble when
 impatient users do multiple clicks.)

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348504
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Output columns from a query that have been formatted as 2 words

2011-11-07 Thread Leigh

 Add a new column to the QoQ?
 
Since you cannot use First Name in a QoQ, you create a new column with a 
valid name. Then use the new column name in your QoQ.


-Leigh

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348505
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Output columns from a query that have been formatted as 2 words

2011-11-07 Thread Leigh

 Leigh I tried your suggestion and it outputs the value of the column:
 cfset queryAddColumn(dataDownload, name, dataDownload[First Name]) /  
 
It should work fine under CF8/9 because query columns are arrays. What is your 
CF version?

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348506
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Output columns from a query that have been formatted as 2 words

2011-11-07 Thread Torrent Girl

  Leigh I tried your suggestion and it outputs the value of the 
 column:
  cfset queryAddColumn(dataDownload, name, dataDownload[First 
 Name]) /  
  
 It should work fine under CF8/9 because query columns are arrays. What 
 is your CF 
version?

I am using CF9 but I don't understand what you are telling me to do. :)

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348507
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Disable submit button after CFFORM validation?

2011-11-07 Thread Justin Scott

 Can anyone suggest a technique for disabling the button
 after the form has passed validation? (The server code that
 runs after gets into trouble when impatient users do
 multiple clicks.)

I had to do this on a credit card processing form a while back.  The
form was identified as ccForm (in the CFFORM tag, name and id
attributes) and the following JavaScript was placed just below the
closing CFFORM tag.  Just replace ccForm anywhere it shows up below
with the name of your form:

script type=text/javascript
// Override the built-in CF error handler.
document.getElementById('ccForm').onsubmit = doValidate;

// Define our own validation function.
function doValidate() {
returnValue = _CF_checkccForm(document.forms.ccForm);
if (returnValue==true) {
$('#btnSubmit').css(display, none);
$('#processingNotice').css(display, block);
return true;
} else {
return returnValue;
}
}
/script

Essentially what this does is override the default onsubmit function
that ColdFusion attaches to the form with a custom function.  That
function then calls the default and if it passes, uses jQuery to hide
my submit button and show a processing div that was previously
hidden.  You can just as easily disable the button if desired.  If the
validation fails, we simply return CF's validation result and do not
change the button status, thus allowing multiple clicks and only
changing it once validation passes.


-Justin Scott

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348508
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Output columns from a query that have been formatted as 2 words

2011-11-07 Thread Torrent Girl

  Leigh I tried your suggestion and it outputs the value of the 
 column:
  cfset queryAddColumn(dataDownload, name, dataDownload[First 
 Name]) /  
  
 It should work fine under CF8/9 because query columns are arrays. What 
 is your CF 
version?

Oh WAIT!! DUH!! I figured it out. That rocks!!! 

Thanks I think this is what I needed.

Sorry, brain is fried and blood sugar is LOW. :)

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348509
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Disable submit button after CFFORM validation?

2011-11-07 Thread John Pullam

Looks like using CFINPUT with validate=submitonce solves the problem. I 
didn't know that existed! 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348510
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm