CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 I want to send more parameters with listbox

Print topic Send  topic

Author Message
hasan

Posts: 6
Posted: 01/11/2009, 10:34 PM

Hello,
I want to send extra more parameters with listbox.
Is this possible with CCS 3.0?

Gr,
H.Akmaz
View profile  Send private message
damian

Posts: 838
Posted: 01/11/2009, 11:34 PM

can you provide an example?

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
hasan

Posts: 6
Posted: 01/12/2009, 2:08 AM

Hello Damian,

I have a table. My Table name is Countries.
In my Countries table I have 4 columns. [country_id, country_name, country_code and country_approved]

I have a listbox.
In my listbox My Bound Column is country_id and my text column is country_name.
If I select one columns in my listbox, I want to send other columns as a parameter.
Other columns are [country_code and country_approved]

Is this possible?
Gr,
H.Akmaz
View profile  Send private message
hasan

Posts: 6
Posted: 01/12/2009, 2:08 AM

Hello Damian,

I have a table. My Table name is Countries.
In my Countries table I have 4 columns. [country_id, country_name, country_code and country_approved]

I have a listbox.
In my listbox My Bound Column is country_id and my text column is country_name.
If I select one columns in my listbox, I want to send other columns as a parameter.
Other columns are [country_code and country_approved]

Is this possible?
Gr,
H.Akmaz
View profile  Send private message
damian

Posts: 838
Posted: 01/12/2009, 2:15 AM

you could probably use an onchange event on your list box to set the values on 2 hidden fields but if you send the country_id you can always lookup the other info at the next step?

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
aondecker

Posts: 58
Posted: 01/12/2009, 4:10 AM

Yes it is possible. Here is how i do it.

I would set the BoundCol to something like this.

(the syntax depends on if you are using SQL or MYSQL. User concat_ws() for MYSQL)

select country_id + "~" + country_name + "~" +country_code + "~" +country_approved as BOUNDCOL, country_name as textcol from YOURTABLE.

Then on your before insert or before update or before whatever you are trying to you you can explode the values out.

$values = explode("~", $YourForm->YourListbox->GetValue());

you will then have an array of values that you can get your separate information from.
View profile  Send private message
melvyn


Posts: 333
Posted: 01/12/2009, 5:15 AM

If you're using mysql, you can try
SELECT concat_ws(";","country_id","country_code","country_aproved") as BOUNDCOL FROM....

This will produce and output as "country_id;country_code;country_aproved"

concat_ws is the mysql function to generate a concacatenated field (as aondecker did manually).

_________________
Melvyn Perez
Puro Codigo
http://purocodigo.com
View profile  Send private message
datadoit
Posted: 01/12/2009, 5:21 AM

Me wonder if you replace the ~'s with something like "&country_id=" +
country_id + "&country_name=" + country_name ... if it'll work without
having to blow it up later?
damian

Posts: 838
Posted: 01/12/2009, 6:57 PM

Quote datadoit:
Me wonder if you replace the ~'s with something like "&country_id=" +
country_id + "&country_name=" + country_name ... if it'll work without
having to blow it up later?
yes - thats what i was thinking after reading that!
its a nice simple solution
_________________
if you found this post useful take the time to help someone else.... :)
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.

MS Access to Web

Convert MS Access to Web.
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.