onLoad and onSubmit question

Javascript coding ..

Moderators: egami, macek, gesf

Post Reply
mayhemiz
New php-forum User
New php-forum User
Posts: 38
Joined: Thu Dec 09, 2010 8:13 am

Tue Jan 18, 2011 10:55 am

Try to use jquery and ajax,that would work.
Here some help:

Code: Select all

function Search(str,type,from)
{
if (str == '') {
alert('You cannot search for nothing!');
} else {
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("content").innerHTML=xmlhttp.responseText;
	var myTD=document.getElementById('left');
	myTD.parentNode.removeChild(myTD);
    }
  }
xmlhttp.open("GET","index.php?t=search&str="+str+"&tyype="+type+"",true);
xmlhttp.send();
}
}
This is a code what i was use =)

Prensil
New php-forum User
New php-forum User
Posts: 81
Joined: Sat May 07, 2011 12:05 am

Sat May 14, 2011 12:34 am

I think you can ajax to submit each answer from a row but for onload event you need to think...

Thanks & Regards,
Prensil Technologies Pvt. Ltd.
php web development company
http://www.prensil.com

User avatar
gandahar
New php-forum User
New php-forum User
Posts: 112
Joined: Tue Mar 15, 2011 4:05 am

Wed Jul 06, 2011 10:32 am

if you dont want tu use ajax or jquery, you can use a simple form with target="myIFRAMEname" and send data via the hidden iframe to the php script, just like a normal form, but with the target targeting to the iframe :)

i use this solution in my projects

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests