473,397 Members | 2,033 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,397 software developers and data experts.

POST a form with XmlHttpRequest

ok here is my problem I have a form in a webpage that I want to submit
and get the result back without reloading the page.

I've seen many times ppl using text/x-www-form-urlencode but I was
wondering if it was possible somehow to submit the form element
directly so I wouldn't have to process the form to put it in a string.

If there is anyway I would be happy if not seems I'll have to
transform the form into a string request.

Thanks in advance for your help.
Jul 23 '05 #1
2 1687


Henri-Bastien wrote:
If there is anyway I would be happy if not seems I'll have to
transform the form into a string request.


XMLHttpRequest is mostly meant to exchange XML as data so you can
directly pass a DOM node like an XML DOM document to the send method but
if you want to send form data as application/x-www-form-urlencoded
content then you have to build that string yourself from the form that
you can walk with the DOM to build the string.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
I don't need to send it in x-www-fomr-urlencoded only thing I need is
to get the same result as doing form.submit without having to reload
the page AND being able to get the result back. Because the script run
localy but I access a remote page. For that reason I can't simply put
the form in an other frame because DOM doesn't allow that in
explorer....

Jul 23 '05 #3

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

Similar topics

7
by: Shannon | last post by:
Hi everyone, I am trying to post some data to a form using the XMLHTTP object, and have run into a problem trying to find the proper location of the receiving page. The form points to a...
5
by: Jarson | last post by:
My JavaScript is trying to POST data to a CGI script (Perl) using XMLHttpRequest. My CGI server gets different data from IE than Mozilla Firefox. // For Mozilla, req = new XMLHttpRequest(); //...
3
by: Jim Lawton | last post by:
Hello, the following bit of (stripped down) code works fine in IE, but on Gecko based browsers - Firefox 1.0.7 Mozilla 1.7.12 it just hangs on the xmlhttpOpen // IE object - works fine...
6
by: mosesdinakaran | last post by:
Hi Everybody, As all knows the difference between GET and POST is in the way how the data is transfered, But in case of ajax Though it may be a post Request we need to format a querystring...
1
by: pritisolank | last post by:
Hello Everyone, With that alert statment alert("calling validateme for "+document.form1.elements); in js things would work fine but if i remoe the form is simply getting submitted in firebug i can...
14
by: FMDeveloper | last post by:
Currently transitioning from a shared host to a dedicated server. The same code that works on the old server is not working on the dedicated server. It is a simple AJAX request like: <code>...
10
by: Peter Michaux | last post by:
Hi, All Ajax libraries I've read use encodeURIComponent() on the name- value pairs extracted from forms before POST ing the result to the server with and xmlhttprequest. I can understand why...
2
by: ajaxcoder | last post by:
Hi In my project i had a login form and i am trying to send the username and password to the server for authentication using xmlHttpRequest. Hence i am using POST request but i am unable to send...
1
by: sukil | last post by:
Hi, I have a requirement to generate a form based on various user selections at runtime. So, I am using XMLHttpRequest to call server side programs and passing them parameters that is then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.