Forum
Topic RSS
20:49
02/03/2010
OfflineBecause im unable to post the data here in a readable format, refer to this post for code.
http://stackoverflow.com/quest.....a-troubles
I for the life of me can not get the form data to submit to the db. As long as reloadaftersubmit is false, it shows on the grid, but any reload of the form or grid erases my changes. Im using the navigator add/edit method. This is idealy what I want to use, but finding a "good" working example is hard to come by. your examples on the page have gotten me to where I am now, but when it comes to posting the data, noobs like me are completely lost.
Ive been working on this all week, and made absolutley no progress, and am at my wits end, please assist!
Hello ,
View my sample code for update product in database with edit form : ( my little experiance and my english ...
)
.HTML :
var gridimgpath = 'js/themes/start/images/'
jQuery(document).ready(function(){
jQuery("#s1list").jqGrid({
sortable: true,
url:'data/devis_detail_view.php?q=1&NumFactures=<?php echo $NumFactures_Factures?>',
datatype: "json",
colNames:['Actions','Interne','Produit','Reference', 'Libeller', 'Commentaire', 'Quantite', 'Remise','Prix unitaire','Prix total'],
colModel:[
{name:'act',index:'act', width:15,sortable:false,align:"center"},
{name:'id',index:'id', width:20,align:"center",hidden:true},
{name:'id_produit',index:'id_produit', width:20,align:"center"},
{name:'Reference',index:'Reference', width:45,align:"center"},
{name:'Libeller',index:'Libeller', width:45,align:"center"},
{name:'commentaire',index:'commentaire', width:50, align:"center",editable: true,edittype:"textarea", editoptions:{rows:"5",cols:"30"}},
{name:'quantite',index:'quantite', width:30, align:"center",editable:true},
{name:'Remise',index:'id_remise', width:20, align:"center",editable:true},
{name:'prix',index:'prix', width:20,align:"center",editable:true,editoptions:{size:5}},
{name:'$total',index:'$total', width:20,align:"center"},
],
rowNum:25,
mtype: "POST",
rowList:[25,50,75],
imgpath: gridimgpath,
pager: jQuery('#s1pager'),
sortname: 'id_produit',
viewrecords: true,
toolbar : [true,"top"],
cellEdit: false,
cellsubmit: 'remote',
cellurl:'data/devis_update.php',
editurl: 'data/devis_update.php',
reloadAfterSubmit:true,
autowidth: true,
forceFit : true,
sortorder: "asc",
gridview : true,
userDataOnFooter : true,
footerrow : true,
altRows : false,
caption:"Détails des Produits",
devis_update.php :
<php require_once('../Connections/gesy.php'); ?>
<?php
include('protect.php');
$id=$_POST[id];
$quantite=$_POST[quantite];
$commentaire=$_POST[commentaire];
$remise=$_POST[Remise];
$prix=$_POST[prix];
print_r($_POST);
mysql_select_db($database_gesy, $gesy);
$modifier="UPDATE factures_produits SET quantite='$quantite', id_remise='$remise', prix='$prix', commentaire='$commentaire' WHERE id='$id';";
$execute=mysql_query($modifier) or die(mysql_error());
?>
Best regards ,
Most Users Ever Online: 994
Currently Online:
40 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66
Log In
Home