i have two division in my file say form.php....
Division A
All data from table abc (here i am getting data from db)
Division B
Some fields
Add Data (Button) will store data in table abc through ajax using following code (It's storing data)
Now my problem is when i add data in Division B i want to update Division A with newly added data through ajax...
for that i am trying this code but i am getting console error say Uncaught SyntaxError: Unexpected identifier
$("#addField").click(function(){
label=$("#ilabel").val();
name=$("#iname").val();
type=$("#itype").val();
$.ajax({
url : 'ajax.php', // this is adding **division B** data in database
data : {reqtype:'insert',label:label,name:name,type:type},
type: 'POST',
success : function(data){
$("#showform").html('<?php echo $d->fetchform() ?>'); // here i am trying to update Division A on success but getting error
}
})
})
$d->fetchform() is giving all the formatted data from the table abc...
i don't know how to deal with this problem.. can you please suggest me how can i do it... (i want to do it through ajax only)
Thanks in advance..