Hi,
Im new to ajax and im using prototype for a project i am working on. I am hoping to call a servlet written in java which holds a hashtable to strings. When i click on a link it opens up a tab - i want to auto insert the valuse held in the hastable into 7 textboxes. Is there a way to do this? I cannot figure out!!!!
Here is the javascript function i have comp up with so far!
[CODE=javascript] function showConfigurati on(){
alert('configur ing the server!!');
new Ajax.Request('s ervlet/Properties',
{
method:'POST',
onSuccess: function(){
Hashtable<Strin g,String> properties = Properties.getP roperties();
document.getEle mentById("host" ).value = "test";
document.getEle mentById("chann el").value = "test";
document.getEle mentById("queue ").value = "test";
document.getEle mentById("port" ).value = "test";
document.getEle mentById("manag erName").value = "test";
document.getEle mentById("usern ame").value = "test";
document.getEle mentById("passw ord").value = "test";
},
onFailure: function(){
alert('Failure' );
}
});
}
[/CODE]
The "test" text above should hold the values pulled back from the servlet.
I would really appreciate any help anyone could give me
Thanks
Im new to ajax and im using prototype for a project i am working on. I am hoping to call a servlet written in java which holds a hashtable to strings. When i click on a link it opens up a tab - i want to auto insert the valuse held in the hastable into 7 textboxes. Is there a way to do this? I cannot figure out!!!!
Here is the javascript function i have comp up with so far!
[CODE=javascript] function showConfigurati on(){
alert('configur ing the server!!');
new Ajax.Request('s ervlet/Properties',
{
method:'POST',
onSuccess: function(){
Hashtable<Strin g,String> properties = Properties.getP roperties();
document.getEle mentById("host" ).value = "test";
document.getEle mentById("chann el").value = "test";
document.getEle mentById("queue ").value = "test";
document.getEle mentById("port" ).value = "test";
document.getEle mentById("manag erName").value = "test";
document.getEle mentById("usern ame").value = "test";
document.getEle mentById("passw ord").value = "test";
},
onFailure: function(){
alert('Failure' );
}
});
}
[/CODE]
The "test" text above should hold the values pulled back from the servlet.
I would really appreciate any help anyone could give me
Thanks
Comment