Reply
Advice on Form Logic
Old 03-27-2008, 07:00 PM Advice on Form Logic
Experienced Talker

Posts: 35
Im new to the programming world aside from HTML so be gentle with me! This project is actually Asp.net w/ C# but its general knowledge so hopefully someone can help. I've managed to make a form post the field data into an SQL database and it posts back to the current page with a confirmation or error message (also with range validations). I want to add another step/page that would allow me to see the values Im about to submit before actually doing it like a "are you sure this is what you want to submit" page.

Should the form store the field data into variables to be displayed on this verification page and then sent those to the DB? Or should the form go ahead and post it to the SQL table and if they choose to change it, remove the data from the table and direct them back to fix the problem? Like I said, Im still new to C logic so any recommendations would be very helpful since Im at a crossroads here. Thanks in advance!

~Dan

Last edited by chrishirst : 03-29-2008 at 11:07 AM. Reason: links removed
Turbo6PGT is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 03-29-2008, 11:09 AM Re: Advice on Form Logic
chrishirst's Avatar
Super Moderator

Posts: 11,452
Location: Blackpool. UK
store the values as variables in session, cookies or a temporary table, the have the user verify and commit the transaction.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-10-2008, 06:08 AM Re: Advice on Form Logic
Junior Talker

Posts: 4
Take advantage of the .Net postback model.

Fill in the form, when the user posts back, show a panel with some literals containing thier data, if they click 'save' in that panel, save it to a database

sean
seanxe is offline
Reply With Quote
View Public Profile
 
Old 04-10-2008, 09:29 AM Re: Advice on Form Logic
Experienced Talker

Posts: 35
I originally had this setup as a Postback BUT they wanted to add some confirmation pages in the middle so that didnt work. I actually got it worked out finally but I stored the initial values as a session var and then on the next page it verifies the info and they can go back to fix it or submit it, where it forwards them to a nice pretty thank you page. So it works I guess.
Turbo6PGT is offline
Reply With Quote
View Public Profile
 
Old 04-10-2008, 09:49 PM Re: Advice on Form Logic
ForrestCroce's Avatar
Half Man, Half Amazing

Latest Blog Post:
Talapus Lake in June Snow
Posts: 3,016
Name: Forrest Croce
Location: Seattle, WA
You could use the postback model and one page that acts differently depending on what 'mode' it's in. Something like:

if(!PostBack) {
...
}
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 04-12-2008, 07:29 AM Re: Advice on Form Logic
Junior Talker

Posts: 4
You can still use the postback model you know, just use some panels which get shown / hidden on a buttons click event...

but if your solution works don't bother trying to change it!
seanxe is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Advice on Form Logic
 

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12513 seconds with 13 queries