I'm making a administration panel which is generated with Jquery's live and post it works fine.Inside the generated page I'm trying to be able to edit a user in their respective rows so i want to run a post function to retreive the input of a textfield and onkeyup use a post ajax function to update the users info into the database.I have an alert over there and it works , but the post function won't connect to the php page (edit_script.php)that supose to connect to the database.I've been stuck at this for 2 days help would be greatly appreciated.
the html

echo "<div class = 'slideBox' id = 'box".$row['id']."' >
<form name ='edit_form'
<p>Username: <input type = 'text' id = 'dyn_usr_up' name = 'user_edit' value = ". $row['username']." '/>
Password: <input type = 'text' name = 'dyn_pass_update' value = ". $row['password']." />
E-mail: <input type = 'text' name = 'dyn_email_update' value = ". $row['email']." /></p><hr/><br/><hr/>
<div id='d_result'>This form is dynamic, it updates as you type. </div></div>";

echo "<div class = 'slideBox_del' id = 'box_del".$row['id']."' >
<input type = 'button' value = 'Confirm Delete' id = 'delete_button".$row['id']."'/>".$row['username']."

</form>

</div>";

the js/jquery:

 $("#dyn_usr_up").live('keyup', function(){

     alert("hi"); 
 $.post('edit_script.php', 
 {user_edit:edit_form.user_edit.value},

 function(dresult)
 {$("#d_result").html(dresult).show();
 return false;
    });})

Try alerting the value you are submiting to see if it's ok.

I also suggest that you use your browser Network Profiler (in development tools) to analyse if the request is being made, and if so what's is being sent and what's being recieved.

var valToEdit = edit_form.user_edit.value;
alert("Editing: " + valToEdit);
$.post(
    'edit_script.php',  
    {user_edit: valToEdit},
    function (dresult, textStatus) { 
        alert("Result: " + textStatus);
        $("#d_result").html(dresult).show();
    }
);

If this doesn't help, try swting to .ajax() and use an error callback function.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.