Solved

Using a CFINPUT to display an editable value

Posted on 2004-08-11
9
196 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

623 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