SunQuest
           Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

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 Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old October 2nd, 2004, 01:21 PM
timlab timlab is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: walden,ny
Posts: 77 timlab User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Which Way To Go?

I have a form . On this form I have information that I would like the user to preview before adding to the database. I would like to have 2 buttons. One button saying "Send To" and the other saying "Change Info". Now if the user likes what they have written, if click, I would like the info to go to the database. If the person doesn't like it and need to make changes, I would like for it to go back to the input screen. Can someone please help me with the coding. Thanks

Reply With Quote
  #2  
Old October 2nd, 2004, 07:51 PM
austinb austinb is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: TX
Posts: 59 austinb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Which Way To Go?

i had to do this once before.
Im sure this isn't the best way, but its most likely the easiest:

<input type="text" value="<?php echo isset($_POST['var1']) ? $_POST['var1']:""; ?>" name="var1">

put this in the form, and put a bunch of hidden fields in the preview page:
<input type="hidden" value="<?php echo $_POST['var1']; ?>" name="var1">
and if they like it it will post the variables to the database script, if they don't it will post it back to the form.

Reply With Quote
  #3  
Old October 3rd, 2004, 12:57 AM
timlab timlab is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: walden,ny
Posts: 77 timlab User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: RE: Which Way To Go?

Thanks for the info, however, I'm really confused with your code. For example, you don't tell me how to either go to the db or back to the input page. But thanks.
Quote:
i had to do this once before.
Im sure this isn't the best way, but its most likely the easiest:

<input type="text" value="<?php echo isset($_POST['var1']) ? $_POST['var1']:""; ?>" name="var1">

put this in the form, and put a bunch of hidden fields in the preview page:
<input type="hidden" value="<?php echo $_POST['var1']; ?>" name="var1">
and if they like it it will post the variables to the database script, if they don't it will post it back to the form.


Reply With Quote
  #4  
Old October 3rd, 2004, 04:20 PM
bakertrg's Avatar
bakertrg bakertrg is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Scottsdale AZ, US
Posts: 2,253 bakertrg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 45 sec
Reputation Power: 4
Send a message via Yahoo to bakertrg
RE: Which Way To Go?

all you need to do is submit the form to itself and have three
submit buttons named submit on the first pass and one named edit and one named confirm on the second pass.

php Code:
Original - php Code
  1.  
  2. if ($submit == "submit"){
  3.     echo "<input type='submit' name='Confirm' value='confirm'>&nbsp;<input type='submit' name='Edit Submission' value='edit'>";
  4. } else {
  5.     echo "<input type='submit' name='submit' value='submit'>";
  6. }
  7.  
  8. // if $submit == "confirm" do your query and if $submit == "edit" display the form witht he changed data
  9.  

you could also do this by echoing the form data to the screen and asking for confirmation as opposed to showing the form on each pass.

Reply With Quote
  #5  
Old October 4th, 2004, 09:28 PM
austinb austinb is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: TX
Posts: 59 austinb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Which Way To Go?

acctually it would probibly be easiest if you just had it open in a new window.

Reply With Quote
  #6  
Old October 5th, 2004, 11:14 AM
bakertrg's Avatar
bakertrg bakertrg is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Scottsdale AZ, US
Posts: 2,253 bakertrg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 45 sec
Reputation Power: 4
Send a message via Yahoo to bakertrg
RE: Which Way To Go?

why? you have to duplicate the code that way. The form only needs one instance if you target self.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Which Way To Go?


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: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway