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 3 of 3
  1. #1
    asm
    asm is offline
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Navigating through forms

    Hi,
    I have three forms of which the second is presented only after the first one is filled and similarly, the third is presented after the second is filled.
    Now my problem is that I do not want to enter the details in the database unless all three are filled correctly.
    So can you tell me a way of storing the data of the first form somwhere before the second is visited ?Also I may need to reload the first form as is if the user clicks on 'back to first' ?

    I think a way to do it is to pass all the data to the second jsp page through the 'action' in the form.But is there any better way to do it?
    Please help me with it.

    Regards
    asm

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My solution would be to do form pagination on the client side: www.klproductions.com/klslideshow.html
    You can do client-side data verification as user goes through "pages" and your server will handle the validation of the complete form.
    If JS is disabled/unavailable/insufficient the user will be presented with one long form (while less convinient it is still accessible).
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #3
    New Coder
    Join Date
    Aug 2004
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Code just to explain the idea not tested.

    Code:
    function storeFormVars(formObj){
    var elements=formObj.elements;
    for(var i=0;i<elements.length;i++){
    navigator[elements[i].id]=elements.value;
    }
    }
    Now your navigator variable will have all the form values. And its scope is across all pages within the window. So you can use this to store form1 values, go to form2, then come back again to form1 and restore values or continue to form3.

    Have fun

    Afru.


  •  

    Posting Permissions

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