Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't exactly understand why so complicated call of ajax and parsing of value from serverpage, but maybe You have one JS code for more than one edit function at more places... But to the point:</p> <p>It looks like You don't have Your <code>&lt;div id="editpersoneelform"&gt;&lt;/div&gt;</code> inside the HTML from where the AJAX is called...</p> <p>Lets suppose You have similar HTML file (I recommend using of jQuery at least for working with elements when You need the AJAX to be called in raw way):</p> <pre><code>&lt;div id="editpersoneelform"&gt;&lt;/div&gt; &lt;div class="jbutton"&gt; &lt;a onclick="edit(\'editpersoneel.php\',\''.$b['id'].'\')"&gt;Adjust&lt;/a&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; function edit(serverpage, persoonid) { $(".opendg").dialog({ open:function () { $(this).load('/location/php/' + serverpage); }, title: 'Change!', autoOpen: true, closeOnEscape: true, height: 335, width: 650, modal: true, resizable: false, close: function(){}, buttons: { "Change": function() { sendedit(serverpage, persoonid); return; }, "Cancel": function() { $(this).dialog("close"); } } }); xmlhttp = ajaxFunction(); if (xmlhttp) { var url = "/location/php/" + serverpage; var pagelength = serverpage.length; var value = serverpage.substr(0,pagelength - 4); var params = "edit=" + value + "&amp;id=" + persoonid; xmlhttp.open("POST", url, true); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-length", params.length); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { if(xmlhttp.responseText != '') { value = value + 'form'; alert(value); $('div#'+value).html(xmlhttp.responseText); } } } xmlhttp.send(params); } } &lt;/script&gt; </code></pre> <p>and then You have Your PHP file that is called by AJAX:</p> <pre><code>&lt;?php if($_POST['edit'] == 'editpersoneel') { //Query run here to get the results $form = '&lt;form&gt; &lt;table&gt; &lt;tr&gt; &lt;td class="first"&gt;Location: &lt;/td&gt; &lt;td&gt;&lt;input type="text" value="'.$result['location'].'" /&gt;&lt;/td&gt; &lt;td class="first"&gt;phonenumber&lt;/td&gt; &lt;td&gt;&lt;input type="text" value= "'.$result[phonenumber'].'" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt;'; echo $form; } ?&gt; </code></pre> <p>If You want to load AJAX response to a certain element, that element has to be recent in the code from where the AJAX is called.</p> <p>Try this and let us know if You'd succeeded.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload