Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthornein
    • CommentTimeOct 18th 2007
     permalink
    Hi everyone,

    My question is simple: I want to find a javascript script that will allow me to take information that is entered into a billing form, and move it over into the same slots for the shipping form.

    I am sure we have all seen this before, where you can click a radio button or a checkbox and your billing information will be automatically displayed in your shipping information as well if those two sections are the same.

    Hopefully someone can help me out with this one.

    Thanks, James
  1.  permalink

    The script isn't entirely necessary, I think, because it's most likely used to store data into a cookie, which in turn is read before displaying the next section of the form. At least for me, this would be easier to do in PHP.

    You might want to search for some Javascript cookie examples, or if you'd like, I can post an example of the PHP version.

    • CommentAuthornein
    • CommentTimeOct 21st 2007
     permalink
    The php example would make more sense I suppose. So I guess I could save the information as values in a variable and have them echo if a checkbox is clicked. Would you be kind enough to show me an example regardless?

    Thanks!
    • CommentAuthorvarland
    • CommentTimeOct 22nd 2007
     permalink

    nein... a PHP example would only work after the form was submitted. If you want it to happen as soon as the user clicks a checkbox, you're going to need javascript. I'll try to post an example later. It shouldn't be very difficult.

  2.  permalink

    Varland might be correct, but wouldn't it be better if there would be an option like Check here if the billing address is the same as your shipping address, with the billing address clearly visible at the time? That wouldn't really require any preprocessing or cookies at all. Then, if the checkbox is checked or there is no information on the shipping address fields, one could assume that the addresses are one and the same.

    • CommentAuthornein
    • CommentTimeOct 22nd 2007
     permalink
    Hmm ok, unfortunatley I am just learning php and have barely touched on javascript. It's for a school project anyways I just wanted to see if I could figure it out. If anyone can post a reference for me to check out for that javascript action that would be great.
Add your comments
    Username Password
  • Format comments as (Help)