Solved

Using a CFINPUT to display an editable value

Posted on 2004-08-11
9
192 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

860 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