close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Submit cookie data with a button

Thread began 1/31/2010 2:46 pm by Daryl | Last modified 2/04/2010 2:09 pm by Eric Mittman | 2204 views | 5 replies |

DarylBeta Tester

Submit cookie data with a button

I have two pages with name and address fields and want to have the ability for the person on the second page to copy the address from the first page.

I guess I can use Cookies Toolkit to copy the address details across, but how would I insert that data should a user click a "Same Address" button?

I assume that I would need javascript to do this....

Any help would be apprecaited.

Sign in to reply to this post

Eric Mittman

You could use the client behavior to store the form in the cookie on the first page. Then on the second page if you have all the same form element names you can use the 'set form from cookie' behavior to populate the fields. You could apply this behavior to a check box to have it so the user clicks on this box to populate that part of the form.

Sign in to reply to this post

DarylBeta Tester

I have managed to get the whole form to submit, but how would I get it to copy the whole form minus three of the form fields?

Sign in to reply to this post

Eric Mittman

To get the form contents to transfer you will need to apply the behavior for set form from cookie on part two. In order for this to work you must ensure that the two forms have elements named the same. If the form element names do not match the values will not be populated.

I did this in an example by applying the store form in cookie behavior to the first form. Then on the second form I added a checkbox. With the checkbox selected I added the set form from cookie behavior. When the box is checked it will set the value from the cookie to the corresponding form elements in the new form. I'm including an example of this for reference.

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

DarylBeta Tester

Hi Eric

Thanks for your reply.

I have managed to get the data to copy across to the new form but can't have explained myself very well.

The problem that I had was that the form not only contained an address, but also name and date of birth.

I only want to copy the address portion of the form accross.

I have tried to find the code which selects the form elements to retrieve the data but I haven't managed to do this - I was hoping to be able to delete the references to the name and dob form fields.

Would you suggest naming these fields differently on the second form so that the data isn't populated?

Sign in to reply to this post

Eric Mittman

You can name the fields differently on the second part, or you can just store the values from the first part of the form differently. Rather than storing the entire form in a cookie you can store the individual form elements in their own cookies. This way you have a lot more control over what data is set by default on the second form by only setting the initial value of the form elements that you want to be populated.

Sign in to reply to this post

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...