Disallowed Key Characters.?array_emails - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Disallowed Key Characters.?array_emails (/showthread.php?tid=66194) |
Disallowed Key Characters.?array_emails - behnampmdg3 - 09-19-2016 Hi; I use ajax submit a form but I get the error Quote:Disallowed Key Characters.?array_emails Here is the code PHP Code: //// This is the form Code: <form id="add_access" method="post"> And on the other page PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); RE: Disallowed Key Characters.?array_emails - InsiteFX - 09-19-2016 Try this: Code: <head> RE: Disallowed Key Characters.?array_emails - mwhitney - 09-20-2016 First, I'm going to reformat the JavaScript to attempt to make the source of the problem more obvious, though I did add the curly braces around the function definition (the omission of which should've caused a different error than the one described): Code: $("#save_now_button").click(function() { In the first argument to $.post(), you're getting a URL with ? at the end, then adding another ? in JavaScript. I have a question, though. Why is it that so many people go through the trouble of using $.post(), then cram their data onto the end of the URL? I even checked the documentation, and this isn't done in the examples given for $.post(). That pair of empty curly braces you're passing as the second argument is where the data goes. It's so much easier to do this: Code: $("#save_now_button").click(function() { |