Joe Filipe
|
| Posted: 04/02/2002, 8:30 AM |
|
I am trying to setup a four sets of list boxes on one form as follows:
Country
Zone 1
Zone 2
Zone 3
Where each zone is dependent of the contents of the previous list box. I know this has been discussed before, and there are alternative ways such as loading all the data first; but due to the amount of data, it would be better to set a onchange function. I have put the following code into the Header section:
Thr form name is Zoning and the page name is SelectZoning, using a formtype Record.
<script>
document.all["Zoning.CountryID"].onchange = formSubmit;
document.all["Zoning.ZoningP1ID"].onchange = formSubmit;
document.all["Zoning.ZoningP2ID"].onchange = formSubmit;
document.forms["Zoning"].elements.tags("INPUT")[0].style.visibility ="hidden";
function formSubmit(){document.forms["Zoning"].submit();}
</script>
I have also coded the following into the BeforeShow:
if not(fldCountryID = "" ) then fldZp1where = " Where CountryId = " & toSQL(fldCountryID,"Text")
if not(fldZoningP1ID = "" ) then fldZp2where = " Where CountryId = " & toSQL(fldCountryID,"Text") & " and ZoningP1ID = " & toSQL(fldZoningP1ID,"Text")
if not(fldZoningP2ID = "" ) then fldZp3where = " Where CountryId = " & toSQL(fldCountryID,"Text") & " and ZoningP1ID = " & toSQL(fldZoningP1ID,"Text") & " and ZoningP2ID = " & toSQL(fldZoningP2ID,"Text")
Problem:
When I execute the page I get the following error:
document.all.zoning.countryID is null or not an object.
Any help in solving this problem is appreciated.
Thanks in advance.
|
|
|
 |
Albert
|
| Posted: 04/03/2002, 12:06 AM |
|
Joe,
I'm not JScript guru, but try to use:
document.form_name.field_name.onchange
sometimes it helps.
|
|
|
 |
Joe Filipe
|
| Posted: 04/04/2002, 1:38 PM |
|
Thanks for your suggestion, but it still does not work. I realy like to get to work. Your help is appreciated.
|
|
|
 |
|