Hallo there
Well am new to sugar crm, apparently am not able to have my onchange functionality working, here is whats happening
i have my .js file, in the custom/modules/Cases/metadata/editviewdefs.php i have this
'includes' =>
array (
0 =>
array (
'file' => 'modules/Cases/Cases.js',
This is good coz the cases.js file shows up in the browser source
Then the field that has the onchange, i have this
array (
'name' => 'account_name',
'label' => 'LBL_ACCOUNT_NAME',
'displayParams' =>
array (
'javascript' => 'onchange="Getreport(this.value);"',
This is not good coz the onchange functionality is not in the browser source code for that field...what the heck is goin on
Can some one please assist a brother
below is my cases.js file (could there be onload missing, if yes what can i add to this file
function makeGETRequest(url, parameters) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
// set type accordingly to anticipated content type
//http_request.overrideMimeType('text/xml');
http_request.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Cannot create XMLHTTP instance');
return false;
}
http_request.onreadystatechange = alertContents;
http_request.open('GET', url, true);
http_request.send(parameters);
}
function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
//alert(http_request.responseText);
result = http_request.responseText;
document.getElementById('cus_type_c').value = result;
} else {
alert('There was a problem with the request.');
}
}
}
function Getreport(dat) { makeGETRequest('try2.php?dat=' + dat, null); }


LinkBack URL
About LinkBacks




Reply With Quote
Bookmarks