SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Storing form values while using confirm() in ajax and struts

    Hey guys,

    My team mates and I are developing an application with ajax and struts. It has so far been a very good experience. The problem we are facing now is we would like to have a confirmation whenever a user who is filling in information in a form, wants to go to another link. I'm currently using the confim(). My idea is that when the user clicks "OK", it forwards that link and when they press "Cancel", it will return to the form and all the data (keyed in and populated using ajax) will still be there. The source of the problem is that we're using ajax and whenever the the cancel button is pressed the page automatically refreshes and all the data is gone. How do I solve this problem? Is there another way to implement confirmation so that the data(keyed in and populated using ajax) will still be intacted ? Thanks in advance.

    Johan

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Welcome to the forums!

    window.confirm returns a boolean, so it depends what you do with this boolean value. Seems like you now reload the page no matter what.

  3. #3
    SitePoint Zealot
    Join Date
    Jul 2006
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Post some code so we can look at it? It might be a problem with your logic.

    Dave

  4. #4
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The link above has a code example, did you check it out?


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
  •