Hello i have the next code to load and update a field in the database:
var strObserva = [
{ type: "settings", position: "label-left", labelWidth: 160, inputWidth: 450 },
{ type:"fieldset" , name:"_observaciones",
list:[
{type: "block", width: 640, list:[
{ type:"input" , name:"observaciones", label:"Observaciones", rows: 5 },
]}
]}];
var form_observaciones = new dhtmlXForm("winObserva",strObserva);
form_observaciones.load("opciones/guardardata/guardarobservacionespedido.php?id="+pedidoactual);
var dpfobservacionespedido = new dataProcessor("opciones/guardardata/guardarobservacionespedido.php?id="+pedidoactual);
dpfobservacionespedido.init(form_observaciones);
I use:
form_observaciones.save();
for save the input, the input is loaded correctly but when i try to save i get the next report in my dhtmlx generated log:
UPDATE LOG
Log started, 17/04/2012 12:04:51
DataProcessor object initialized
P_observaciones => Esta es una observacion de prueba test
P_!nativeeditor_status => updated
ids => P
Row data [P]
observaciones => Esta es una observacion de prueba test
!nativeeditor_status => updated
UPDATE mayoreo.pedidos SET observaciones=‘Esta es una observacion de prueba test’ WHERE pedidoid=‘P’ AND (pedidoid = ‘P-0240’)
Edit operation finished
0 => action:updated; sid:P; tid:P;
Done in 0.0060429573059082s
Want to comment that the loading is working fine with the next report in the log:
====================================
Log started, 17/04/2012 12:04:23
SELECT pedidoid,observaciones FROM mayoreo.pedidos WHERE pedidoid = ‘P-0240’
Done in 0.0041379928588867s
Also want to comment that in the line:
var dpfobservacionespedido = new dataProcessor(“opciones/guardardata/guardarobservacionespedido.php?id=”+pedidoactual);
I added the “pedidoactual” id just to confirm if the id was the problem because is VARCHAR type, but when i use the id in:
form_observaciones.load(“opciones/guardardata/guardarobservacionespedido.php?id=”+pedidoactual);
and use the form_observaciones.save(); the id is pedidoid=‘P’ when the update is triggered, so where is the issue here, anyone have an idea of what can be the issue in this case or have experience dealing with update forms.