Results 1 to 2 of 2

Thread: Popularing a form from XML

  1. #1
    Join Date
    Aug 2009
    Posts
    4

    Popularing a form from XML

    Hi folks

    I'm reworking an existing website, and there are a series of web forms, surveying the client. The data from each form is saved in mpsql fields, and its actually saved as XML format, so that each form field becomes an xml element, and the value that was entered becomes the content of the xml tag - eg <inputBox1>my entry</inputBox1>

    When I'm looking for, is a simple (as simple as possible!) javascript or ajax system that I can use to read the xml content out of the database, and populate the form on the page with the right values

    Then, i'm also looking for again for an ajax feature to save the content back to the xml format, and into the database.


    There is already a system in place, but it seems very complicated, and also uses some custom php classes - I want to avoid using these so that the system can run on hosts that don't have the costum php classes installed.

    Hope this makes sense

    Jon

  2. #2
    Join Date
    Feb 2007
    Location
    Ireland
    Posts
    1,007
    Saved as MPSQL? Do you mean MySQL or are you actually referring to MPSQL (a gui interface for PostgreSQL)?

    Ok, I'm going to assume you meant MySQL (as you meantioned fields)? How are they stored in the database? Has it been xml enabled? If so... then it makes sense.

    So what you will need to do is fetch the result set (which will be in an XML document format) and then parse it. You can use the SimpleXML extension to easily parse it.
    “The best thing about a boolean is even if you are wrong, you are only off by a bit.”

Similar Threads

  1. binding a selection from a drop down menu to a form variable
    By eskimo in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 10 May 2009, 09:48 AM
  2. accessing xml data with html form
    By bbw in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 25 Jan 2007, 11:20 AM
  3. passing information from 1 form to another
    By amanxman in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 11 Apr 2006, 03:44 AM

Posting Permissions

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