want to add one more auto-complete input field i have no ides how to do it. adding new field to to my html page using JS and checking for auto complete in .XML.PHP file
this is my .js file
(function(){
var WINDOW=window,
DOCUMENT=document,
SCAN=gui.app.scan,
SYS=gui.system,
U=gui.util,
D=gui.dom,
E=gui.event,
W=gui.widget,
form,
formname='gblForm-Unit',
autos={},
reqd={
fields:['unitId'],
types:{
'unitId':'alphanum'
}
};
/**
* Set a field as required if it exists
* @private
* @param {String} id ID of the field
* @returns {Void}
*/
function setRequired(id){
if (D.get(id)){
reqd.fields.push(id);
}
}
Handles the onLoad event for the window
function onload(){
if (SCAN.ENABLE_JAVASCRIPT){
if (D.get('#'+ formname)){
setRequired('unitId');
form=new U.FormSubmit(formname, reqd, ws.error.getFormError);
form.registerScanningField('unitId');
form.registerButton([
{ id:'gblBtn-Submit', type:'submit' }
]);
}
}
}
E.add(WINDOW, 'load', onload);
}());
this is my .xml.php page
<?php
try {
$unitId=ws::scrub(@$_GET['unitId'], 'alphanum');
$xml = new wsResultDocument();
$data = $xml->getNodeSet('data');
if ($unitId){
$unit = wsModel::execSP('GetUnit', array('data' => $unitId));
if (!sizeof($unit)){
throw new UserException('UNIT_VALUE_INVALID', $unitId);
}
$groups = array(
array(
'column' => 'UNMT_Serial',
'table' => 'UNMT',
'nodeName' => 'unit',
),
array(
'column' => 'UTDT_Label',
'table' => 'UTDT',
'groupName' => 'values',
'nodeName' => 'value',
),
);
$data->addNodeSet(wsResult::groupedNodeSet($unit, $groups, null, false));
}
}
catch(Exception $e){
wsError::logException($e);
$xml = wsError::exceptionToResult($e);
}
return $xml;
?>