Solved

Problem updating fileds with URL parameter

Posted on 2011-03-16
5
290 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
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 …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

626 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