![]() |
Updating my news post (with jquery/Ajax) - 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: Updating my news post (with jquery/Ajax) (/showthread.php?tid=29479) |
Updating my news post (with jquery/Ajax) - El Forum - 04-12-2010 [eluser]pickupman[/eluser] Here's a working sample of your code. Unzip and place in your CI application folder. I added a small sql file for the table layout I used for testing. You can use the url /newstest/edit/(some news id). I renamed the model stuff as to not to overwrite any of your stuff, but you should still be able to follow the code. Updating my news post (with jquery/Ajax) - El Forum - 04-12-2010 [eluser]DynamiteN[/eluser] [quote author="pickupman" date="1271099039"]Here's a working sample of your code. Unzip and place in your CI application folder. I added a small sql file for the table layout I used for testing. You can use the url /newstest/edit/(some news id). I renamed the model stuff as to not to overwrite any of your stuff, but you should still be able to follow the code.[/quote] oh , thank you, will check iy out right away , let u know if its working ![]() EDIT: I tried to implement your code to mine, but i just get errors on errors, i dont know, maybe i need a break for a day from this, i will try again tomorrow with a bit fresher eyes.. Updating my news post (with jquery/Ajax) - El Forum - 04-12-2010 [eluser]pickupman[/eluser] You may need to adjust the name of the table in the example I attached to match yours. Take a look in the models folder, and edit the name of the table where it gets/updates the record. Updating my news post (with jquery/Ajax) - El Forum - 04-12-2010 [eluser]DynamiteN[/eluser] Okey now i am getting somewhere... i just altered for the models to pick up 'news_id' instead of id so i didnt get errors there i went going on tihis jquery, Code: jQuery(document).ready(function($){ And now it does work.. sort of.. if i post the data now with the fields all filled in correct it then shows up "news updated" and if i would leave lets say author field empty, it then show that validation error above the form, jsut as i want it to ... -- NOW the problem ![]() if i would to lets say press two times when the author field i empty it shows the validation error, BUT it show it two times, same goes if i would to actually update the news correct, and then maybe see a typo in the news or something, and fix it and press update again it then goes ahead adnd update it again, but it then repeats the line "news Updated" next to the first "News Updated" line other wise it does work. any idea how to fix that repeat issue, also i would like to have something like that busy function to show when i press before any success or fail message comes up , just so that it shows it's doing something , if u know what i mean ![]() thanks alot for this help, would still have been stuck if you wouldnt have helped me ![]() Updating my news post (with jquery/Ajax) - El Forum - 04-12-2010 [eluser]pickupman[/eluser] Looks like you may have removed part of the code I had that took care of the dupes. It's the line under the submit handler. Code: jQuery(document).ready(function($){ Updating my news post (with jquery/Ajax) - El Forum - 04-12-2010 [eluser]DynamiteN[/eluser] oh, fixed that now, now it works :O YAY Think i will leave all this now like that until i will need some more of my web app ![]() THANK YOU, u have helped out BIG time <3 hopefully, i can help back sometime , when my knowledgebase is a little bitgger ![]() |