![]() |
[SOLVED] can't save transaction without details - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: [SOLVED] can't save transaction without details (/showthread.php?tid=27165) |
[SOLVED] can't save transaction without details - El Forum - 02-14-2010 [eluser]maria clara[/eluser] [quote author="theprodigy" date="1266225784"]I'm assuming this is still on saving the new company through the jquery grid. when submitting the add company form, does it contain the user id in a hidden field with the name "item"? Or, it doesn't even have to be a hidden field. Basically, are you submitting a form field, with the name "item" along with the rest of the form (company_name, company_code)?[/quote] yes it is. this part of the code is where my problem occur: Code: $item = $this->input->post("item"); because it was not posting the data but in my database it was added already. Now, my problem is how can i post it to show it in the browser.??? [SOLVED] can't save transaction without details - El Forum - 02-14-2010 [eluser]theprodigy[/eluser] so, you want $data['item'] to be the new list of companies assigned to the user (the previous list, plus the new one just added)? [SOLVED] can't save transaction without details - El Forum - 02-14-2010 [eluser]maria clara[/eluser] [quote author="theprodigy" date="1266226535"]so, you want $data['item'] to be the new list of companies assigned to the user (the previous list, plus the new one just added)?[/quote] yes, exactly that's what i wanted. and i want it to post the data i added. [SOLVED] can't save transaction without details - El Forum - 02-14-2010 [eluser]theprodigy[/eluser] show me your users model, and the javascript code for your ajax company add call. [SOLVED] can't save transaction without details - El Forum - 02-14-2010 [eluser]maria clara[/eluser] [quote author="theprodigy" date="1266227253"]show me your users model, and the javascript code for your ajax company add call.[/quote] here's my USERS MODEL: Code: <? i'll attached the javascript here [SOLVED] can't save transaction without details - El Forum - 02-14-2010 [eluser]xeroblast[/eluser] the switch doesnt work bcoz in your switch() switch($postConfig['action']){ // has a value of 'oper' and in your case case $crudConfig['create']: // is same as case 'add' case $crudConfig['update']: // is same as case 'edit' case $crudConfig['delete']: // is same as case 'del' there is no 'oper' in your case that is why you cant save/edit/delete... [SOLVED] can't save transaction without details - El Forum - 02-14-2010 [eluser]maria clara[/eluser] [quote author="xeroblast" date="1266227721"]the switch doesnt work bcoz in your switch() switch($postConfig['action']){ // has a value of 'oper' and in your case case $crudConfig['create']: // is same as case 'add' case $crudConfig['update']: // is same as case 'edit' case $crudConfig['delete']: // is same as case 'del' there is no 'oper' in your case that is why you cant save/edit/delete...[/quote] what can i do with that??? [SOLVED] can't save transaction without details - El Forum - 02-14-2010 [eluser]theprodigy[/eluser] Quote:foreach ($postConfig as $key => $value){That is the code that is over-writing it. $_REQUEST['oper'] is being passed in, and is set to 'add', therefore it is setting $postConfig['oper'] to 'add'. [SOLVED] can't save transaction without details - El Forum - 02-14-2010 [eluser]maria clara[/eluser] do i need to take this out of my code?? Code: foreach ($postConfig as $key => $value){ [SOLVED] can't save transaction without details - El Forum - 02-14-2010 [eluser]theprodigy[/eluser] no, as I was saying, it is the code that is allowing it to work. You take it out and you will have to alter some other things to get your site to function again. I was just letting Xeroblast know the part of the code that is setting the $postConfig element. |