Solved

Using a CFINPUT to display an editable value

Posted on 2004-08-11
9
194 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Technology Resume 7 88
Create an automated page index 9 110
certificate error on website only in internal network 24 107
Record locking on classic ASP 3 64
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

751 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