CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge -> General/Other

 Dependent listbbox using editable grid

Print topic Send  topic

Author Message
mramirez18

Posts: 56
Posted: 06/08/2006, 6:07 AM

I am using Codecharge 2.0.7, my question is related to using a dependent list box in an editable grid.

When I click url ID from form licenseallocate GRID, it takes me to form licenseallocate1 to edit the record. I am getting the following error.

Script error
Line 344
Char
objforms.license_type_id is null or not an object.

<script language="Javascript">
// Description : Level1(*,Value1,Value2, ...)
// Level2(*,Value11OfValue1,Value12OfValue1,Value21OfValue2, ...
// Setting selected values for level1, level2, level3 after refresh web site

var level1s = new Array();
<!--Beginlevel1s-->
level1s["{level1}"] = new Array(
<!--Beginlevel2_2s-->
{level2_2}
<!--Endlevel2_2s-->
);
<!--Endlevel1s-->



// Defintion vars and objects
var objforms = document.forms["licenseallocate1"];
var objlevs1 = objforms.license_type_id;
var objform = document.licenseallocate1;
var objlev1 = document.licenseallocate1.license_type_id;
var objlev2 = document.licenseallocate1.license_id;
var objchange2 = document.all["license_type_id"];
var cFieldNameLevel1 = "license_type_id";
var cFieldNameLevel2 = "license_id";
var nSelectedIndexLevel2 = 0;
var k=0;
for (i in level1s)
{
level1_name_id = i.toString().split("#");
objlevs1.options[k] = new Option ( level1_name_id[0] , level1_name_id[1])
k=k+1;
}

function fill_level2() {
var lbopt = objlev1.options;
var arr = level1s[lbopt[lbopt.selectedIndex].text];
key = lbopt[lbopt.selectedIndex].text + "#" + lbopt[lbopt.selectedIndex].value;
for (i=objlev2.options.length; i >=0 ; i--)
{
objlev2.options=null;
}
for (i=0; i < level1s[key].length; i++)
{
level2_name_id = level1s[key].split("#");
objlev2.options = new Option(level2_name_id[0],level2_name_id[1])
if (objlev2.options.value==nSelectedIndexLevel2)
{
// The select field value
objlev2.options.selected=true;
}
}
}

objchange2.onchange = fill_level2;


function parseQueryString (str)
{
str = str ? str : location.search;
var query = str.charAt(0) == '?' ? str.substring(1) : str;
var args = new Object();
if (query)
{
var fields = query.split('&');
for (var f = 0; f < fields.length; f++) {
var field = fields[f].split('=');
// If URL has value for Level1 or Level2
// My condition for creation args for dependent combobox, only
if (field[0]==cFieldNameLevel1 || field[0]==cFieldNameLevel2)
{
if (field[1]>0)
{
args[unescape(field[0].replace(/\+/g, ' '))]=unescape(field[1].replace(/\+/g, ' '));
if (field[0]==cFieldNameLevel2)
{
// The number of selected index for fieldlevel2
nSelectedIndexLevel2 = field[1];
}
}
}
}
}
return args;
}

var args = parseQueryString ();

for (var arg in args)
{
var opt = objform.elements[arg].options;
for (i=0; i < opt.length; i++)
{
if (opt.value == args[arg])
{
opt.selected = true;
break;
}
}
}

fill_level2();

</script>
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.