Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I remove + sign from string in Jquery $('#sender_name'). val(). If I entered any space then it include a + sign

So in my controller I cant get accurate value due to + sign (I am using Ajax call that goes every time when I enter a single word).

For example if I entered in text field 'Hello World' then it will return 'hello+world' i want to remove + sign.

$( "#sender_name" ).autocomplete({
            var newUrl="<?=base_url()?>login/city/"+$("#sender_name").val();
share|improve this question

closed as off topic by Nick, Su', paulmorriss Feb 19 '13 at 10:16

Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

When a plus sign replaces a space, that is a sign that the text has been url-encoded. You just need to url-decode the text in your controller. You don't state what programming language you use, but all languages have some a function available for doing this.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.