CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Many-to-Many via Two ListBoxes

Print topic Send  topic

Author Message
Animetal

Posts: 27
Posted: 05/07/2008, 2:21 PM

Hi,

Im trying to follow the example (http://examples.codecharge.com/ExamplePack/ManyToManyListboxes/ManyToManyListboxes.php)

But now I cant find the reason why I cant get back the items from the linked listbox to the available one, and if I leave an item in the linked listbox and clic on submit it add the same item again, leaving the list with two identical items. Right now I dont know how CCS do to remove the linked item from the listbox, another point is this example wont run in FireFox, the javascript is not working properly in this browser.

Thanks in advance
View profile  Send private message
Animetal

Posts: 27
Posted: 05/07/2008, 2:39 PM

Just to be a little more specific....

In this code
if($EmpID >0){  
    if( ($Actions == "Delete") || ($Actions == "Update")) {  
	   //Delete project employees links  
	   $EmpProjectConn->query("DELETE FROM projects_employees WHERE emp_id=".$EmpProjectConn->ToSQL($EmpID,ccsInteger));  
    }   
    if($Actions == "Update"){  
       //Insert assigned employees  
       reset($ProjectList);  
       while(list($key,$ProjectID) = each($ProjectList)){  
         if(intval($ProjectID)>0){  
            $EmpProjectConn->query("INSERT INTO projects_employees (project_id, emp_id) VALUES (".$EmpProjectConn->ToSQL($ProjectID,ccsInteger).",".$EmpProjectConn->ToSQL($EmpID,ccsInteger).")");  
		 }  
       }  
    }  
  }

Everything as I can see is working properly but how CCS remove the linked items using this code?
if Im updating the field.
View profile  Send private message
Animetal

Posts: 27
Posted: 05/08/2008, 6:48 AM

I found my mistake, and it was something basic grrr....
in this line:
( ($Actions == "Delete") || ($Actions == "Update"))
I was thinking the || was like AND and not OR so I was skipping that SQL code, after checking it I found my variable wasnt typed correctly so after changing it everything is working fine in IE 7.

Now If somebody knows how to make this work on FireFox (I think this is not working because of something in the javascript code) it would be appreciated

Thanks
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.