Jump to content

ajax form


gish

Recommended Posts

hi

 

I have a form that works great and I have an ajax script that works great but as soon as I place the form into the ajax script it keeps losings the post value I assuming i need to add something but I don't know what?

 

the ajax openpage has the php code include("form.php");

 

this is the form

	echo "<form method='post'>";

	echo "<input type=text  name='form_value' value='' MaxLength='2' size='' style='text-align:center; 
			width:150px; height:90px; border-color:white; font-family:arial, verdana:bold; font-size:80px' tabindex='0' >"; 		

	echo "<br>";

	echo "<input type=submit value='' style='width:0px; height:0px; font-family:arial, verdana:bold; font-size:px'  >";
	echo "</form>";

 

function getNewXMLHttpRequest() {

  var findbrowser;

    try {

		  findbrowser = new ActiveXObject('Microsoft.XMLHTTP');

    }

    catch(a) {

      try {

           findbrowser = new XMLHttpRequest();

      }

      catch (a) {

         findbrowser = false;

      }

    }

    return  findbrowser;

}



function check1()

{

if (request.readyState ==4)

{

	 				var randomDiv = document.getElementById("pictjs");

				randomDiv.innerHTML = request.responseText;

}

}

function ajaxselection(){			
	/// this is for the ajax

			 request = new getNewXMLHttpRequest();

			 var url ="openpage.php";

			 request.open("GET", url, true);

			 request.onreadystatechange = check1;

			 request.send(false);

}


window.onload = menus;

function menus(){	

	ajaxselection();

}

Link to comment
https://forums.phpfreaks.com/topic/136795-ajax-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.