| Title: |
Best Way to Handle Checkboxes with Insert Query?
|
| Date: |
12/27/02
14 Posts
|
| Summary: |
The simplest way to work around the possibility of a nonexistent checkbox form variable is to add
<CFPARAM NAME="form.your_checkbox_var"
TYPE="boolean" DEFAULT="false">
|
to the top of the action page. You could also test for a 'no value' condition within your query by using IsDefined(). As always, remember to protect your SQL by referencing parameters within the CFQUERYPARAM tag. |
| |
| Title: |
Can I Put LIKE '%#form.SearchText#%' into a CFQUERYPARAM?
|
| Date: |
12/27/02
7 Posts
|
| Summary: |
Need to use LIKE with CFQUERYPARAM to accommodate different database platforms? Try this:
WHERE table.fieldname LIKE
<CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR"
VALUE="%#form.searchtext#%">
|
|
| |
| Title: |
Padding Zeros
|
| Date: |
12/27/02
13 Posts
|
| Summary: |
Use NumberFormat(), like this: NumberFormat(mynumber,"0000000"), to create a standard length by left-padding zeros. |
| |