Solved

Using a CFINPUT to display an editable value

Posted on 2004-08-11
9
189 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
Comment Utility
Hi inverted_2000,
 
what is the error pls indicate them.

Regards,
---Pinal
0
 
LVL 2

Author Comment

by:inverted_2000
Comment Utility
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
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 2

Author Comment

by:inverted_2000
Comment Utility
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
Comment Utility
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
Comment Utility
Hi inverted_2000,
 DELETE *
 FROM freight
 WHERE ID ='#deletefreight#'
will work.

Regards,
---Pinal
0
 
LVL 21

Accepted Solution

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

Regards,
---Pinal
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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…
This video teaches users how to migrate an existing Wordpress website to a new domain.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now