Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How can I make a home page like "page control in VB"

    Hello,

    Any one knows How can I make the page like:


    ______________
    | Step1| | Step2 |
    ----------------------------------------------
    | username .............................................|
    | other Item.... ....................................... |
    | ..............................................................|
    | ............................................................. |
    ------------------------------------------------

    User can first fill in Items in step1 and click step2 , continue fill in items(user can also go back to page 1 when they click it), then submit. All items in page 1 and page2 can be sent to
    "back.asp"?
    How can I do it?

    Many thanks
    Last edited by geqy; 07-05-2002 at 03:19 PM.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Does a user have to submit Step 1 before getting to Step 2? Are you puttting all this info in a db?

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I hope, the user can switch betwwen these two (or more) steps, and submit togather. just like the Page control in Visual Basic!

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I can not really think of an easy way to do this since both steps will be submitted together. The way I would do it is have three forms: frmStep1,frmStep2, frmMain.
    Put frmStep1 and frmStep2 in divs and on the Click of Step 1 make the frmStep1 visible , and frmStep 2 hidden vice versa for the click of Step 2. Whenever the user submits the form write some javascript that will pull the form values from frmStep1 and frmStep2 and put them into the frmMain. All the form fields on the Main form will be hidden. I have not tested this.

  • #5
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    I have an Idea.

    Start with "Section 1" The user fills out information and to move on, the user must submit "Section 1" information. after that, that information is in the db. The user can now move to "Section 2".

    "Section 2" will have the next form. The user can fill in information in this form and hit submit, if he wants to go back to "Section 1", he clicks on the tab back to "Section 1", but a popup comes up saying, If you do this without submiting the page you are on, you will lose any new information. The user clicks cancel or ok.

    Ok will take you to "Section 1", cancel will let the user stay still.

    He goes back to "Section 1", the db loads information already entered into the correct fields. Now the user can now hit sumbit with he's changes and the db will update.

    You can see where I am going with this, can you not?

  • #6
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    Oh, and to make sure information doesn't get mixed up, you might want to make sure there is a user login script working for you. If you need a good working one, you might want to ask whammy for his site, so you can get his.

  • #7
    New Coder
    Join Date
    Jun 2002
    Location
    Pilipinas
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, this is one case where session variables can be of some use. Assign the name/value pairs of each input field to key/value pairs in the session object.

    Here is a variation, though is done in ASP.NET, using a control's ViewState property.


    Using Page State

  • #8
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    you don't need session variables for this:

    step1.asp

    <form name="step1" action="step2.asp" method="post">
    Step 1:<br>
    <input name="user">
    <input name="others">
    ...
    <input type="submit" name="btnStep2" value="Next">
    </form>


    step2.asp

    <form name="step2" action="back.asp" method="post">
    Step 2:<br>
    <input name="otherdata">
    ...
    <!--put data from step1 to hidden fields-->
    <input type="hidden" name="user" value="<%=Request.form("user")%>">
    <input type="hidden" name="others" value="<%=Request.form("others")%>">
    ...

    <input type="button" name="btnStep1" value="Back" onclick="history.back()">
    <input type="submit" name="btnStep2" value="Next">
    </form>

    in the back.asp page, retrieve the data from step2 page and save all of them in the db.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •