Greetings.
I am rather new to this Script.aculo.us - so please be gentle ;-)
I am trying to create something like this:
<pre>
<table>
<tr><td><input type=text name=a_id_$x>
</td></tr>
<tr><td><input type='button'
onclick='javascript:add_interface_line($x, ".$row["customer_id"].", ".
$asset_id.");' name=addinterface value='Add Interface Line'
title='Adds one line'></td></tr>
</table>
</pre>
And dumping something like this on it:
<pre>
function eventCallback(element, entry)
{
alert (entry + '&q=' +
$('assetInterfaceID_'+counter
+'_IP').getValue() + '&counter='+counter+'&c_id='+customer_id);
return entry + '&q=' +
$('assetInterfaceID_'+counter
+'_IP').getValue() + '&counter='+counter+'&c_id='+customer_id;
}
function add_interface_line(counter, customerid,
assetid)
{
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)
{
var newdiv =
document.createElement('div');
newdiv.innerHTML =
xmlhttp.responseText;
var container =
document.getElementById('newinterface');
container.appendChild(newdiv);
new Ajax.Autocompleter
(
'assetInterfaceID_'+counter+'_IP',
'autocomplete_choices','printiphint.php',
{
fullSearch: true, frequency: 0, minChars: 1, callback:
eventCallback
}
)
}
}
xmlhttp.open('GET','printnewinterface.php?q='+counter
+'&c_id='+customerid+'&a_id='+assetid,true);
xmlhttp.send();
}
</pre>
Of course there is ample div's for it to handle returnable data. But
what it does not work right..
could anyone help me with it?
Basicly I need dynamicly addition of rows with interface information..
among those an IP field with autocomplete - in every row.
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.