SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to keep dynamically generated HTML elements and values in them?

    Hello Guys and "SitePoint", hope you are getting well.
    My name is Dmitriy. I am first time here , I am from Australia.

    I will appreciate if you will have time to read my message and be able to answer, actually help me to solve my problem…

    The Question / Problem:

    I got a 4 step form, which is on step 3 dynamically adding and removing elements with JS ( text boxes, option buttons, drop downs, etc ) .

    Step 1 – Personal Details
    Step 2 - Employment Details
    Step 3 – Property Details
    Step 4 – Review & Submit

    Let’s say I came to Step 3 and the Form got a button – “Add property”.
    I click on button and the following elements appear:

    Property Value
    Outstanding Loan
    Monthly Payment
    Lender


    I filled all information and clicked second time “Add property”.

    The same appears

    Property Value
    Outstanding Loan
    Monthly Payment
    Lender



    And so on…Just exactly the same like in examples in the following articles:

    1. http://www.htmlgoodies.com/primers/j...le.php/3594621 - written by Mark Kahn

    2. http://www.dustindiaz.com/add-and-re...th-javascript/ - written by Dustin Diaz


    Then, after I finished with all properties ( adding them, deleting them ) I moved to Step 4 to review all entered details.

    Let’s say I noticed that on Step 3 (Property Details) - I have entered incorrect “Property Value” for example.

    I clicked “Edit Step 3” and as soon I arrived back to “Step 3” I see that all information about properties are gone…

    Just blank page as it was initially , only one button “Add property”

    How to keep dynamically generated HTML elements and values in them?

    in multi step form
    in single step form
    after you clicked Back Button
    after you clicked Refresh Button

    at the moment I ve got the same result – Blank Page

    I know its possible, but how. Why I am so sure that its possible, because I ve seen nearly the similar application at www.virginhomeloans.com.au

    Their application does the same on Step 3 - adding and removing assets dynamically and their elements are there….

    I am using PHP to manipulate all data…
    Actually I know how to keep values in static multi step form. I am using the same example - http://www.apptools.com/phptools/multipage.php for static form.

    Guys, please help me...May be you have some code examples which will give me an idea how to do that, may be someone already had such problem before and know how solve it, may be it so simple and I am walking around and can't see, etc...

    I don't know I am 100% lost…

    Thank you &
    Warm Regards,

    D.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,446
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)

    passing values

    Hi webdeal, welcome to the forums,
    You can pass variable values from one page to another several ways.
    As GET vars in the URL eg. page.html?var=val
    But as you are using forms POST variables with your server-side script would be better. (got PHP?) Maybe SESSION vars would be best. You can test to see if they exist, and if so use their value. To solve "back button" problems you have to make sure the pages do not cache.

  3. #3
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Mittineague,
    Thanks for your reply, but that is not exactly what I am looking for


  4. #4
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your best off using a server side language for this requirement.

    For stuff like previous employers, you can have a previousEmployment class, which you can store employer objects into, and if need be re-populate a page with the data so it can be editted.

    All this time, it will be stored in a session, which can be read from/writen.



Bookmarks

Posting Permissions

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