Be sure to use rawurlencode/rawurldecode to preserve plus signs -- they
get turned automatically into spaces if you use normal urldecode (or
rely on the automatic form decoding behavior). encodeURIComponent() is
the equivalent in JavaScript.
Walter
On Apr 8, 2007, at 6:27 AM, tronen wrote:
>
> I have this function doing a Ajax.Request. However, when I am looking
> at the POST array that I get to my script it does not contain the +
> sign in the "phone number" that I might enter.
>
> function submitSignup() {
> var success = function(t) { submitSignupSuccess(t); }
> var failure = function(t) { submitSignupFailure(t); }
>
> var url = "signup.php?action=register";
> var pars = "firstname=" + $F('firstname');
> pars += "&lastname=" + $F('lastname');
> pars += "&title=" + $F('title');
> pars += "&phone=" + $F('phone');
> pars += "&email=" + $F('email');
>
> var req= new Ajax.Request(url, {method: 'post',
> postBody:pars, onSuccess: success, onFailure:
> failure});
>
> }
>
> function submitSignupSuccess(t) {
> //do some stuff
>
> }
>
> function submitSignupFailure(t) {
> //do some stuff
>
> }
>
> Any insights in this?
>
> /Peter
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---