Click here to Skip to main content
12,698,600 members (31,871 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET VBScript Javascript CSS , +
Hi all.
How can I send a Form with AJAX (Post method)?
It means is there a free AJAX script about it

Thank you
Posted 8-Oct-08 23:27pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Hi,
I suggest using one of these frameworks : ExtJS, Prototype, Dojo, Scriptaculous...
It would make it much easier.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

<pre lang="xml"><html>

<head>
<script language="javascript" type="text/javascript">
   var XMLHttpRequestObject_test = false;
   var strSend;

   if (window.XMLHttpRequest) {
      XMLHttpRequestObject_test = new XMLHttpRequest();
   } else if (window.ActiveXObject) {
      XMLHttpRequestObject_test = new ActiveXObject("Microsoft.XMLHTTP");
   }

   function test()
   {
      if (XMLHttpRequestObject_test) {
         strSend = "receive.php?txt_example=" + document.getElementById('txt_example').value;
         XMLHttpRequestObject_test.open("GET", strSend);
         XMLHttpRequestObject_test.onreadystatechange = function ()
         {
            if (XMLHttpRequestObject_test.readyState == 4 && XMLHttpRequestObject_test.status == 200) {
               document.getElementById('here').innerHTML = XMLHttpRequestObject_test.responseText;
                 }
             }
            XMLHttpRequestObject_test.send(null)
            }
       }
</script>

<body>

<input id="txt_example" type="text" /><br />
<input id="submit" type="button" onclick="test()" />
<br /><br />
<div id="here"></div>

</body>
</html>


  Permalink  
  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.170118.1 | Last Updated 3 May 2010
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100