how to display data which is get from data base in html bage using ajax

Discussion in 'Meet and Greet' started by palmyra, Jul 4, 2010.

  1. palmyra

    palmyra New Member

    Joined:
    Jul 4, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I am working now on Graduation Project with Php and ajax
    I have a problem with php
    the problem is
    I have a form which has input fields the user can input values in these fields to apply some operation on them
    and he can save the form values in the database and he can load values from database
    i did the save operation by use java script and save values in database
    but when i worked with load operation i could get values from database to the java script but i didn't know how to fill this values in the form by ajax because i don't want to refresh the page

    this is the javascript which return the data
    the data is array of values that i want to fill it in the form
    function load_parameters()
    {

    var val1 = document.getElementById("profile_name_select").value;
    $.post("?rt=saveload/load",{profile_name:val1} ,
    function(data)
    {
    document.getElementById("test").innerHTML=data;

    alert(data);
    });
    }
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice