Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem updating fileds with URL parameter

Posted on 2011-03-16
5
Medium Priority
?
293 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
  • 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 2000 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

971 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