In the scenerio below, how would I set a default value - 99 maybe -
for form.group_sort_#gpIDX# - if the form field was left blank?
cfloop index=idx list=#FORM.GROUPid#
cfquery name=update
UPDATE MyTable
SET
group_sort = #evaluate(form.group_sort_#gpIDX#)#
where link_group =
- Original Message -
From: Les Mizzell [EMAIL PROTECTED]
In the scenerio below, how would I set a default value - 99 maybe -
for form.group_sort_#gpIDX# - if the form field was left blank?
I'm sure there are many ways, but this should work. Also, don't forget to
secure those
You could do this, it assumes the form element would always be passed but
might be blank. If the form element may not get passed then you could do a
cfparam but that would not handle if it passed and blank. Also I assumed
#gpIDX# was really supposed to be #idx#
cfloop index=idx
Erf, I left off some pound signs on the where clause
where link_group = '#Form[thisGROUP_#idx#]#'
On Fri, Sep 5, 2008 at 10:32 AM, Aaron Rouse [EMAIL PROTECTED] wrote:
You could do this, it assumes the form element would always be passed but
might be blank. If the form element may not get
Les Mizzell wrote:
The only thing I can find that works is:
cfif thisNL.alignHEAD EQ rgt
or thisNL.recordcount NEQ 1
checked=checked
/cfif
Which is a little uglier that setting thisNL.alignHEAD to rgt by
default if it isn't anything else.
If thisNL is a query, you CAN reset a
: Setting a default value and dynamically checking a radio button
Les Mizzell wrote:
The only thing I can find that works is:
cfif thisNL.alignHEAD EQ rgt
or thisNL.recordcount NEQ 1
checked=checked
/cfif
Which is a little uglier that setting thisNL.alignHEAD to rgt by
default
1) why don't you use form.alignHEAD instead of thisNL.alignHEAD? if you
must use thisNL, then maybe add cfset thisNL = structnew() before your
cfparam tag...
2) you don't need those # inside len(trim())
3) your cfif block is redundant - you already set your var with cfparam
if it does not exist
3) your cfif block is redundant - you already set your var with cfparam
if it does not exist
I had both there testing to see if one of them would catch the
null/empty value and set the variable. *Neither* is catching is, so it's
not getting set.
So, looking at it again. I want the first
If I do cfoutput#thisNL.alignHEAD#/cfoutput - these nothing there, ,
so I'm not sure why the below won't set the varialbe to rgt in this case.
cfif NOT len(trim(thisNL.alignHEAD))
cfset thisNL.alignHEAD =rgt /
/cfif
This works:
cfif thisNL.recordcount EQ 0
cfset
cfif thisNL.recordcount EQ 0
cfset thisNL.alignHEAD =rgt /
/cfif
Spoke too quick - no it doesn't.
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
10:16 AM
To: CF-Talk
Subject: Re: Setting a default value and dynamically checking a radio button
If I do cfoutput#thisNL.alignHEAD#/cfoutput - these nothing there, ,
so I'm not sure why the below won't set the varialbe to rgt in this
case.
cfif NOT len(trim(thisNL.alignHEAD))
cfset
to decide whether or not to check the box/radio
..:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
http://cf4em.com
-Original Message-
From: Les Mizzell [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 08, 2008 10:16 AM
To: CF-Talk
Subject: Re: Setting a default value
The only thing I can find that works is:
cfif thisNL.alignHEAD EQ rgt
or thisNL.recordcount NEQ 1
checked=checked
/cfif
Which is a little uglier that setting thisNL.alignHEAD to rgt by
default if it isn't anything else.
The below is on a page to add or edit records.
When you visit the page, if no recordset is returned by the query, it
will ADD when the form is submitted. If a record is returned, it will
update. Standard stuff..
Small problem I'm having - I need to set a few default values to check
some
Dear list,
I'm sure there is a simple answer to this basic question.Sorry for
being such a noob: I'm working on my first application!I hope to
become a useful member of the CF community one day.But first you will
have to put up with my stupid questions for a while.
Stupid question the second:
try this on for size
SELECT name=project
CFOUTPUT query=get_projects
OPTION value=#ID#cfif ID is get_details.ID selected/cfif#projectname#/OPTION
/CFOUTPUT
/SELECT
- Original Message -
From: Chris Kavanagh
To: CF-Talk
Sent: Wednesday, August 18, 2004 8:33 PM
Subject: setting a default
-Talk
Sent: Wednesday, August 18, 2004 8:33 PM
Subject: setting a default value in my SELECT tag
Dear list,
I'm sure there is a simple answer to this basic question. Sorry for
being such a noob: I'm working on my first application! I hope to
become a useful member of the CF community
=get_projects
OPTION value=#ID#cfif ID is get_details.ID
selected/cfif#projectname#/OPTION
/CFOUTPUT
/SELECT
- Original Message -
From: Chris Kavanagh
To: CF-Talk
Sent: Wednesday, August 18, 2004 8:33 PM
Subject: setting a default value in my SELECT tag
Dear list,
I'm sure
we all cringe at our first app(s) .. or atleast I hope WE do : )
glad to help and good luck!
- Original Message -
From: Chris Kavanagh
To: CF-Talk
Sent: Wednesday, August 18, 2004 9:05 PM
Subject: SOLVED: setting a default value in my SELECT tag
Dear Ewok,
Thank you, you're
19 matches
Mail list logo