close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Update record and Back button update

Thread began 7/29/2010 4:12 pm by wbrooks199805 | Last modified 7/21/2011 2:50 pm by wbrooks199805 | 1645 views | 20 replies |

wbrooks199805

Update record and Back button update

I am trying to achieve a back button to update the questionaire_llc.php page (uploaded files) and that updates the confirm page and database. I think I have it turned around some where.
It is updating the database twice.

Can you please let me know how I can achieve this? THANK YOU!

Attached Files
Archive.zip
Sign in to reply to this post

Jason ByrnesWebAssist

change the name of the submit button on the first page so that it is no longer named button.

you have the update triggered on button: Button pressed.

Both forms have a button named button.

only the second form should have a button named button.

Sign in to reply to this post

wbrooks199805

My Other problem

Okay I will try that. Also, How do you keep the fields filled with the session value on pressing a back button again? I have tried to duplicate it and I am doing something wrong. Can you take a look? Oh I don't have a back button at on these pages but tried to achieve that.

Sign in to reply to this post

Jason ByrnesWebAssist

add this code at line 1 of the second page:

php:
<?php

if(!session_id()) session_start();
foreach(
$_POST as $key => $val) {
    
$_SESSION[$key] = $val;
}
?>




this will create a session variable for each form element using the same name.

So $_POST['name'] will create $_SESSION['name']


the on the first page, add this at line 1:

php:
<?php if(!session_id()) session_start();



then go to the binding panel and click the plus button. Select Session value and create a session binding for each form element using the same name as the form elements.

in design vie, select each form element and click the lightning bolt next to initial value, select the corresponding session binding.

For the select list, click the dynamic button, then click the lightning bolt next to Select Value Equal to and select the session.

Sign in to reply to this post

wbrooks199805

Thank You..will try it out

And let you know..Monday or Tuesday.

Sign in to reply to this post

Jason ByrnesWebAssist

Ok, hopefully it all goes well.

Sign in to reply to this post

wbrooks199805

somewhat worked..still need help

The session variable worked. THANK YOU! Will keep this in my notes so I won't forget again. :)

The button thing didn't work. After I changed the button, it wouldn't post to the database at all.

I changed it back as it was posting to the database only once except when I want the user to modify the info. When the user goes back to the form page (first page), it updates the database with the user info twice adding a new ID. I tried using a hidden field
<input name="hiddenField" type="hidden" id="hiddenField" value="<?php echo $_SESSION['CompanyID']; ?>" />

but it wouldn't work. What am I missing for the update? Thanks in advance!

Sign in to reply to this post

Jason ByrnesWebAssist

where did you change the button name?


you neewd to change it on the questionair_llc.php page:
<td><input name="button" type="submit" class="formfield" id="button" value="Continue" /></td>

change the name of the button to anything except "button"

Sign in to reply to this post

wbrooks199805

I did..

I did change the name of the button.
Sorry..Yes I did that and then it wouldn't post to the database at all.

Sign in to reply to this post

Jason ByrnesWebAssist

ahh,


the forms action on the second page is set to post to another page:
<form id="form1" name="form1" method="post" action="yourorder.php">


change that to post to itself:
<form id="form1" name="form1" method="post" action="confirm_questionaire_llc.php">



you can set the insert record behavior to redirect to the yourorder.php

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...