CodeIgniter Forums
CJAX preserve plus sign ( + ) in form inputs - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: CJAX preserve plus sign ( + ) in form inputs (/showthread.php?tid=60950)



CJAX preserve plus sign ( + ) in form inputs - El Forum - 08-08-2014

[eluser]Needle[/eluser]
I've been using the CJAX Framework with CI and things have been working smoothly, with AJAX calls passing as expected. However, I recently noticed that the plus sign "+" is not making it from my form inputs to my PHP handler script. Rather, the plus signs get replaced by spaces, so:

[email protected] -> email [email protected]

I believe this is due to CJAX and the way it handles the url encoding, but I'm stuck trying to pinpoint the exact code within the CJAX core. Web searches indicate that encodeURIComponent may be the missing piece, but I'd like to know if this is expected behavior for CJAX and if there is some way to encode the form fields within CJAX in a way that preserves the plus signs.


CJAX preserve plus sign ( + ) in form inputs - El Forum - 09-30-2014

[eluser]Needle[/eluser]
I found a solution with help from CJAX's author.
See this discussion.