473,289 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

prototype.js ajax w/ post - how to send '+' character

Hi,

Firstly, I don't know if this is just and isolated thing with the
prototype.js library or
is a problem in general with ajax calls with a '+' character, so i am
posting it here.

I am trying to send input from a form to do a live php boolean
search. so an example
search string is
'+neoflex +standard +output -green'

the problem is something is filtering the '+' and i can figure out to to
send it.

here is the html and js that i am using.

<input type="text" id="prodid" onkeyup="autosearch(this)" name="prodid" />

function autosearch(element)
{ new Ajax.Request('ajax-search.php',
{ method: 'post',
postBody: element.name + '=' + escape(element.value),
onComplete: showResponse
});
return false;
}

ajax-search.php just echos (for testing right now)
$_POST['proddes']

'neoflex standard output -green'

This demo does the same thing if you enter something like '+jack' or
'jack+jill'
http://24ways.org/examples/easy-ajax-with-prototype/
http://24ways.org/advent/easy-ajax-with-prototype
any ideas?
Chuck
Mar 1 '06 #1
2 4614
Zif
chuck wrote:
Hi,

Firstly, I don't know if this is just and isolated thing with the
prototype.js library or
is a problem in general with ajax calls with a '+' character, so i am
posting it here.
The amount of help you'll get here for prototype.js is probably about
the same as that provided by its author's documentation. Search the
archives.

I am trying to send input from a form to do a live php boolean
search. so an example
search string is
'+neoflex +standard +output -green'

the problem is something is filtering the '+' and i can figure out to to
send it.

here is the html and js that i am using.

<input type="text" id="prodid" onkeyup="autosearch(this)" name="prodid" />

function autosearch(element)
{ new Ajax.Request('ajax-search.php',
{ method: 'post',
postBody: element.name + '=' + escape(element.value),


Use encodeURIComponent, not escape (see ECMAScript Spec Section 15.1.3).
It may not help...

[...]

--
Zif
Mar 1 '06 #2
Zif said the following on 3/1/2006 12:40 AM:
chuck wrote:
Hi,

Firstly, I don't know if this is just and isolated thing with the
prototype.js library or
is a problem in general with ajax calls with a '+' character, so i am
posting it here.


The amount of help you'll get here for prototype.js is probably about
the same as that provided by its author's documentation. Search the
archives.


I would endeavor to say that the help you will get for prototype.js is
better sought out from the author. It's not a very, umm, popular thing i
this group and the predominant opinion of it borders between junk and
"something VK might write".

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 1 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: NextOne | last post by:
Hi ! Is it possible to send an AJAX XMLHttpRequest using prototype.js API for a multipart/form-data ? I already done parsing form parameters and sending GET/POST request, but does this work...
45
by: bigdadro | last post by:
I've created a new class using prototype.js. After I make the ajax.request all references to this.myClassMethodorVariable are lost. Does the ajax method blow out the object persistance? I'm fairly...
5
by: dougwig | last post by:
I'm trying to handle the scenario where a user's session times out and and their ajax request triggers a redirection by the webserver (302 error?). I'm using Prototype 1.4 and the my works great...
31
by: Tony | last post by:
I just noticed that prototype.js is one of the files in the Ajax.NET distribution - I'm pretty concerned about this. Does anyone know if this is the same "prototype.js" that is not well-liked...
7
by: BeeRich | last post by:
Hi folks. I built an ajax.updater reply in a website on a Mac, and she works fine. It's a simple reply, the html supplied is correct, and I also supply the target DIV as well. Just wondering...
3
by: jacobstr | last post by:
I've noticed Object.extend used in a few different ways and I'm having trouble distinguishing why certain usages apply to a given situation. On line 804 Ajax.Base is defined as follows: ...
3
by: Tarik Monem | last post by:
Hi Everyone, Still a newbie with FLEX, and I've passed arrays using AJAX to FLEX before, but I've never passed links to FLEX. Basically, this is the OUTPUT, which I wanted, but I'm given an...
3
omerbutt
by: omerbutt | last post by:
hi there i have downloaded a prototype tooltip from http://www.nickstakenburg.com/projects/prototip/ the logic it uses is to call the script after creating the <div> for example i am using the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.