CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 listbox disabled onload event

Print topic Send  topic

Author Message
bedollandres

Posts: 48
Posted: 05/24/2006, 7:36 AM

I have a page with search and grid. On the onload event of the page I have this in order to disable the dependent listbox:
  
        var sel_index = document.t_asuntoSearch.s_id_sector.options[document.t_asuntoSearch.s_id_sector.selectedIndex].value;  
        if (sel_index == "") {  
                //Clear child listbox  
                        for(var i=document.t_asuntoSearch.s_id_empresa.length;i>0;i--) {  
                        document.t_asuntoSearch.s_id_empresa.options = null;  
                }   
                document.t_asuntoSearch.s_id_empresa.options[0] = new Option("Seleccionar un Sector","");  
                document.t_asuntoSearch.s_id_empresa.disabled = true;  
        }  

it worked great until I added a BeforBuildSelect on the dependent listbox.. anybody know why?

The beforebuildselect code:
  
	Select Case Session("Area")  
		Case 7  
			t_asuntoSearch.s_id_empresa.DataSource.Where = " id_sector = 2"   
		Case 11  
			t_asuntoSearch.s_id_empresa.DataSource.Where = " id_empresa = 6 or id_empresa = 4 or id_empresa = 11 or id_empresa = 5" 	  
		Case Else  
			t_asuntoSearch.s_id_empresa.DataSource.Where  
	End Select  

_________________
bedollandres
View profile  Send private message
bedollandres

Posts: 48
Posted: 05/26/2006, 8:55 AM

my css horizontal menu is causing the problem because of this line:
window.onload=startList;

anybody know how I can do this another way?
_________________
bedollandres
View profile  Send private message
bedollandres

Posts: 48
Posted: 05/26/2006, 9:38 AM

I found the solution, hope it helps anyone out there...

in your menu page (includable page) change this:
  
window.onload=startList;  

for this:
  
function WindowOnload(f) {  
    var prev=window.onload;  
    window.onload=function(){ if(prev)prev(); f(); }  
  }  
WindowOnload(startList)  

_________________
bedollandres
View profile  Send private message
bedollandres

Posts: 48
Posted: 05/26/2006, 9:39 AM

I took this function from:

http://blog.firetree.net/2005/07/17/javascript-onload/
_________________
bedollandres
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.