SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Evangelist
    Join Date
    Oct 2001
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Form data (how to save/edit)

    I hope I can explain this so you understand.

    Let's say I have an online form that the user needs to edit. The form is a combination of text-input boxes and drop-down selects and check boxes.

    One section on the form is several check boxes that the users is allowed to choose a maximum of 3 boxes.

    Right now the user gets a message, upon submitting the edited form, that says "you have selected more than 3 boxes" if they have went over the limit.

    Then when they go back to select only 3 boxes the other fields, that they have just edited, that data was not saved.

    Is there a method that would allow the just-edited data still in the form so the user doesn't have to retype/re-enter all of it?

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,635
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    How to do this has nothing to do with the database, it really depends on what application platform you are using.

  3. #3
    SitePoint Evangelist
    Join Date
    Oct 2001
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The coder that is developing the site for me told me:
    as you have 2 sets of data: one set before and one set on submit .... so only one can be stored, not 2 ...
    He is developing the site on a Red Hat Linux Server. Is that what you mean by platform?

  4. #4
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,635
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I really meant PHP or ASP or ASP.NET or RoR or whatever.

    Anyhow, what he needs to do is reflect the user's submitted values in the form when returning the error message. Using a little javascript to help prevent posts of invalid data would help.

    Your coder probably needs to post the question in the appropriate forum here so he can get the help he needs.

  5. #5
    SitePoint Evangelist
    Join Date
    Oct 2001
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wwb_99 View Post
    I really meant PHP or ASP or ASP.NET or RoR or whatever.

    Anyhow, what he needs to do is reflect the user's submitted values in the form when returning the error message. Using a little javascript to help prevent posts of invalid data would help.

    Your coder probably needs to post the question in the appropriate forum here so he can get the help he needs.
    It is PHP.

    I'll try to get him to post a message here but I doubt he will.

    I wish I could find an example of a page that does what I want, to show him it is possible.

  6. #6
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,273
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by edprush View Post
    ...but I doubt he will.
    sounds like a closed mind

    of course it's possible to retain the partially entered form field values when displaying error messages

    any competent programmer can do it

    for example, http://www.quirksmode.org/dom/error.html

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  7. #7
    SitePoint Evangelist
    Join Date
    Oct 2001
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My coder is telling me that it is possible to retain the form data on a new form but not when editing a form.

    The example r937 used is only for the first-time submittal, right?

  8. #8
    SitePoint Zealot
    Join Date
    Dec 2005
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    heh, I really don't mean to sound like a dick, but I hope you're not paying any more than $10/hour for your "developer". He obviously doesn't know what he's doing. I think it's time to find yourself a new developer.

    Anyway, it's relatively simple, but it's done within PHP, and has absolutely nothing to do with the database itself. The information shouldn't even hit the database until it's 100% validated.
    Kiopa Software -- Demo Now Online! Check it out!
    Goal: Consolidate all data & tools you use on a daily basis.
    Grand opening special, licenses FREE for a limited time.

  9. #9
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,273
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    thread moved to php forum
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  10. #10
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,635
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RDFrame View Post
    heh, I really don't mean to sound like a dick, but I hope you're not paying any more than $10/hour for your "developer". He obviously doesn't know what he's doing. I think it's time to find yourself a new developer.

    Anyway, it's relatively simple, but it's done within PHP, and has absolutely nothing to do with the database itself. The information shouldn't even hit the database until it's 100% validated.
    This man speaks the truth. I have been doing this in every web form I have made since I was a n00b.

  11. #11
    SitePoint Evangelist
    Join Date
    Oct 2001
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is the most recent message the coder mentioned to me:
    the problem is what all chekcboxes for categories are dynamically generated from db, they are not static and don't have a static name on form, they are together an array. lets move forward.
    Does that make it impossible?


    Does anyone have an example of a form that allows a user to EDIT the form but also retain the edited data as it's validated?


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
  •