Run sql from javascript?
690818May 8 2009 — edited May 8 2009Hi,
I'm putting autocompletion on a field in a tabular form. The part of the autocompletion works fine right now. I've done this according to the example of Denes Kubicek on http://htmldb.oracle.com/pls/otn/f?p=31517:178:3706123996529876::NO
But now I need to run an sql query to get the id of an employee according to his "personeelsnummer" and return the id into another field on the same row of the tabular form.
1: How can I run an sql query from javascript?
2: How can I put the returned value from the sql query into a field in the tabular form?
This is my javascript so far:
<script language="JavaScript" type="text/javascript">
function f_register(p_this, p_row) //this is called onfocus of the autocompletion field.
{
var p_registered = $x('P9_ITEM_ID').value;
var p_this_name = $x(p_this).id;
var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
'APPLICATION_PROCESS=getSearchListTab',9);
gReturn = get.get();
if (p_registered != p_this_name)
{
register(p_this_name, "TBL_WERKNEMERS", "PERSONEELSNUMMER", "blue", "red");
$x('P9_ITEM_ID').value = p_this_name;
}
}
function get_werknid(p_this, p_row) // this is called onblur of the autocompletion field.
{
alert('test');
}
</script>
Any help would be greatly appreciated,
Bram.