ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 12th, 2005, 01:47 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
Checking inside the Post Page

Hey all, quick question.

So, i'm doing a check inside a post page to see if a record exsists similar to the one the user is currently trying to input.

What I want to do, is if a similar record is found I want to give the user a choice, to either click button A and continue processing the record, or click button B and abort.

Now i'm not quiet sure how to do this, aborting the process is easy enough, but i'm not sure how to set a button inside the post page to basically say "if the user clicks this continue processing"

Thanks
Caden

Reply With Quote
  #2  
Old September 12th, 2005, 01:55 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
I'm thinking that I can base the if off of if the check query is gt 0 and if a variable = 0 or 1

is it possible for me to post back to a page that was just posted retaining the information inside that post?

I think i'll try it right now...hmm, don't think that worked, or is going to work...

Last edited by Caden : September 12th, 2005 at 02:26 PM.

Reply With Quote
  #3  
Old September 12th, 2005, 03:00 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
No, you have to manually maintain the state of the form. The easiest way to do this is to set defaults when you want the form to be blank (ie <cfparam name="firstName" default=""/>) which will default all the form fields to blank (or whatever you want them to be).

So in the form you can do

<input type="text" name="firstName" value="#firstName#">

But when you are posting back to the form, now those values will exist and instead of defaulting them to blank they'll have the values that were posted from the form.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #4  
Old September 12th, 2005, 03:49 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
One more quick one...

Can I set application variables from other pages...

so, I have a variable set to 0 inside the application.cfm page...can I set it to 1 from a different page?

Thanks
Caden

Reply With Quote
  #5  
Old September 12th, 2005, 03:56 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
nevermind

Reply With Quote
  #6  
Old September 12th, 2005, 04:24 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
You can, but I wouldn't recommend it. Application.cfm/Application.cfc is meant for application-wide configuration and processing. Something specific to a single page in your app should not be manipulated that way.

Reply With Quote
  #7  
Old September 12th, 2005, 04:26 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
hmm, well I think I have to have a global variable somewhere that I can use as a flag, not sure how else to do it without the application file.

Reply With Quote
  #8  
Old September 12th, 2005, 05:12 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
What kind of flag?

Reply With Quote
  #9  
Old September 13th, 2005, 08:52 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
just a variable set to 0 or 1 that isn't on the page where my code is.

Reply With Quote
  #10  
Old September 13th, 2005, 09:10 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
But what is the flag actually for? And remember that Application.cfm runs before EVERY page request...it's generally a red flag when you are adding something to this file that will only be used by one page.

Reply With Quote
  #11  
Old September 13th, 2005, 11:28 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
Ohh this is what happens.

I am inputing files into the database, and inside the post page I am checking against the database to see if a similar file is already there based off of the first 3 letters of the first and last name.

So what's happening is inside the post page I do an if statement checking if the SQL query pulled anything and the variable inside the application page is at 0.

So, if that if is satisfied it sets the variable to 1 and I give the user a check saying basically "a similar record exsists, would you still like to enter this record"

if they click yes then because the variable is 1 it posts back to itself and bypasses that original if statement, posts and sets the variable back to 0.

My problem was setting a flag so the app knows if a user has just posted normally or posted wanting to add a checked record into the database. I can't set a variable inside the post page because once it posts back to itself it will be reset, creating my problem.

Reply With Quote
  #12  
Old September 13th, 2005, 12:44 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
Couldn't you just pass an additional hidden form field that you can use as the flag?

Reply With Quote
  #13  
Old September 13th, 2005, 01:46 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
...

Yes, yes I suppose I could.

I think i'll go do that now.

Thanks

Reply With Quote
  #14  
Old September 13th, 2005, 02:02 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Checking inside the Post Page


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums