Solved

Problem updating fileds with URL parameter

Posted on 2011-03-16
5
289 Views
Last Modified: 2012-05-11
When I update with the second form, it runs but the fields do not update.  If I change '#URL.ID#' to the id number that is in the url it does update the fields.  What am I missing?

Thanks
<cfparam name="URL.ID" default="">
<cfparam name="FORM.Firm" default="">
 <cfparam name="FORM.GROW" default="N"> 
<!--- Create an empty error string --->
<cfset strError = "">

<!--- If the form is submitted --->
<cfif isDefined("FORM.Submit")>
 
<!---    <cfset strError = ""> --->
 <cfquery  NAME="Added" datasource="#datasource#">
	        UPDATE SubscriptionIA
			SET Firm='#FORM.Firm#',
				GROW='#FORM.GROW#'
			WHERE ID='#URL.ID#'
            </cfquery>

Open in new window

0
Comment
Question by:JohnMac328
[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
  • 3
  • 2
5 Comments
 
LVL 39

Expert Comment

by:gdemaria
ID: 35151157
what is the action of your <FORM tag?  

You can remove the action completely so the page calls itself with all the same paramters, that will keep the parameter in tact.

0
 

Author Comment

by:JohnMac328
ID: 35151179
It is

<cfform action="#cgi.script_name#" method="post">
0
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
ID: 35151281

That's why, you're losing your query string variables.  

Did it work after removing the action?



You can also do it this way...

<cfform action="#cgi.script_name#?#cgi.query_string#" method="post">

0
 

Author Comment

by:JohnMac328
ID: 35151308
I see - that makes sense.
0
 

Author Closing Comment

by:JohnMac328
ID: 35151311
Thanks again
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 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