Solved

Using a CFINPUT to display an editable value

Posted on 2004-08-11
9
191 Views
Last Modified: 2006-11-17
Okay eveybody,

First...please look at the screenshot I took to help you see what I am trying to do:

http://www.acedoran.com/images/postpage.gif

Code can be found @:
(form page) http://www.acedoran.com/freight.txt
(action page) http://www.acedoran.com/refreshfreight.txt

We are trying to make my actionpage accept changes made to a date column in the lower list part of the screen, so that they user can simply change the date and click update. Then they don't have to reenter the whole load of freight, but simply change the date.

The following code is still producing errors:

<CFPARAM name="Action" default="">
<CFPARAM name="form.deleteFreight" default="">
<CFIF Action is "Delete Checked Messages" AND len(deletefreight) gt 0>
<CFQUERY NAME="displayfreight" DATASOURCE="ADOpenFreight">
DELETE *
FROM freight
WHERE ID in (#deletefreight#)
</CFQUERY>
<CFLOCATION URL="freight.cfm">
<cfelse>
<cfloop index="listElement" list="#form.id#">
<CFQUERY NAME="updatefreight" DATASOURCE="ADOpenFreight">
UPDATE freight
SET dc = #FORM["dc" & listElement]#
WHERE id = '#listElement#'
</CFQUERY>
</cfloop>
</CfIF>
<CFLOCATION URL="freight.cfm">

The code at the top of this page is still the same, so you can reference it and I will know what you are reffering to.
Thank you all again very very much for your help
Chris
0
Comment
Question by:inverted_2000
  • 4
  • 3
9 Comments
 
LVL 21

Expert Comment

by:pinaldave
ID: 11775348
Hi inverted_2000,
 
what is the error pls indicate them.

Regards,
---Pinal
0
 
LVL 2

Author Comment

by:inverted_2000
ID: 11775549
The error I was getting is:

Invalid CFML construct found on line 1 at column 11.  
ColdFusion was looking at the following text:
,

__________________________________________________________________________
The person that was trying to help me said...
__________________________________________________________________________
Is the ID column in your database numeric or text?

The reason I ask is, if #deletefreight# is a list, and the column ID is text, then you have to surround each variable in the list #deletefreight# with apostrophes, to denote that the values are text:

    DELETE *
     FROM freight
     WHERE ID in (#listqualify(deletefreight, "'")#)

__________________________________________________________________________
But that still causes the error
__________________________________________________________________________


0
 
LVL 21

Expert Comment

by:pinaldave
ID: 11775592
Hi inverted_2000,

something like this...

 DELETE *
 FROM freight
 WHERE ID in ('#deletefreight#')

Well, this may not be your answer... where is your line 1 which is creating the error. you have to post the code of that page. It is little confusing here.


Regards,
---Pinal
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 2

Author Comment

by:inverted_2000
ID: 11776369
Okay Pinal,

This is the deal...look at the screenshot to get an idea of what I am trying to pull off here:
http://www.acedoran.com/images/postpage.gif

Also, it doens't matter which line is causing the error because it thinks that DeleteFreight is a list and that the dc is text (DC is the date field).  That is causing the error and it is looking for the ","

All the code is here:
(form page) http://www.acedoran.com/freight.txt
(action page) http://www.acedoran.com/refreshfreight.txt

I will owe you more then you know if you get this to work (o:
Chris
0
 
LVL 2

Author Comment

by:inverted_2000
ID: 11776543
Also...the delete fuction worked fine until I started trying to allow the user to update the date from the list.  So on the actionpage I had to add the UPDATE statement to update the database with the new date that the user puts in.  I figure that these 2 actions on the actionpage are conflicting somehow.

Thanks again (o:
0
 
LVL 21

Expert Comment

by:pinaldave
ID: 11779900
Hi inverted_2000,
 DELETE *
 FROM freight
 WHERE ID ='#deletefreight#'
will work.

Regards,
---Pinal
0
 
LVL 21

Accepted Solution

by:
pinaldave earned 500 total points
ID: 11779903
Hi inverted_2000,
 DELETE *
 FROM freight
 WHERE ID like '#deletefreight#'
will work.

Regards,
---Pinal
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Read about why website design really matters in today's demanding market.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to dynamically set the form action using jQuery.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question