I have an existing intranet site with a form with a form in it (that is controlled by very simple ajax) so that I can add a table to a form with a lot of information.
I'm working with temp tables witch is not the perfect solution.

Now I'm looking for a way to do this in drupal, because I all ready have a internal site in drupal and works like a charm. But I can't seem to find a way to get what I want.

I'm working with the 5.5 and there is a subform module but it's for 4.7 so I can't really use it.

Could I just import the code I'm using at the moment?

here is the javascript

var xmlHttp

function adduser()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="procedures/proc_adduser.php";
url=url+"?naam="+document.getElementById('Naam').value+"&aarduitgave="+document.getElementById('aarduitgave').value+"&bedrag="+document.getElementById('bedrag').value+"&component="+document.getElementById('component').value;
xmlHttp.onreadystatechange=stateChangedAdduser;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 

function stateChangedAdduser() 
{ 
if (xmlHttp.readyState==4)
{ 
$("#t_WA").tablesorter();
document.getElementById("adduser").innerHTML=xmlHttp.responseText;
}
}

Can I use something like that in drupal? Or is there a other way with other modules?