Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Form Mail Multiple Steps

limecitylimecity Posts: 14Member
I am always puzzled about this.

How do you create a forms that has multiple steps or page?
How does this work?

What i wanted was create something like this:

[Step 1- Page 1 ]
Register User Info

[Step 2- Page 2]
Select products ----- SUBMIT

Please guide me. thanks.


Comments

  • zibadianzibadian Posts: 6,349Member
    : I am always puzzled about this.
    :
    : How do you create a forms that has multiple steps or page?
    : How does this work?
    :
    : What i wanted was create something like this:
    :
    : [Step 1- Page 1 ]
    : Register User Info
    :
    : [Step 2- Page 2]
    : Select products ----- SUBMIT
    :
    : Please guide me. thanks.
    :
    :
    :
    This kind of things cannot be done using only html and javascript, since neither can store on the server.
    The general outline is like this: The HTML page contains most often forms to post the information to the server. The server parses this information and based on the info supplied performs certain checks. In case of your first page, the server should check if the user info is correct. This might be done using a lookup of the info in a server-stored database, but might also include server-to-server communication with bank servers or other registry services.
    The second page can be based on edit boxes or check boxes to select products (depending on the needs of the service). Posting this info to the server will add it to a special database, which stores all the sale information. This information can then be accessed by employees to process the purchase.
    Javascript can be used to pre-validate the entries, but by itself it cannot completely process all the data.
    Since this is such a broad question my answer is only one of the possible methods used and is maybe a bit vague, but I hope this makes things a bit clearer.
  • mac_doggiemac_doggie Posts: 488Member
    : I am always puzzled about this.
    :
    : How do you create a forms that has multiple steps or page?
    : How does this work?
    :
    : What i wanted was create something like this:
    :
    : [Step 1- Page 1 ]
    : Register User Info
    :
    : [Step 2- Page 2]
    : Select products ----- SUBMIT
    :
    : Please guide me. thanks.
    :
    :
    :

    If you only want to use javascript and send the data via email you could do it, but the userdata won't be validated ofcourse. But you can create a form that allows you to add data in steps like a wizard...

    you would have to create a form with multiple div's that you would dynamicly give a disply: block or display:hidden style...

    e.g.
    [code]
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />


    website - page

    function show(step) {
    switch(step) {
    case 2 :
    document.getElementById('step1').style.display = 'none';
    document.getElementById('step2').style.display = 'block';
    document.getElementById('step3').style.display = 'none';
    break;
    case 3 :
    document.getElementById('step1').style.display = 'none';
    document.getElementById('step2').style.display = 'none';
    document.getElementById('step3').style.display = 'block';
    break;

    }
    }





    firstname
    lastname









    [/code]
    ;-)
    -mac-
    mailto:mac_doggie@hotmail.com
    the Netherlands...


Sign In or Register to comment.