CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 How to do Listbox and textbox to one data field

Print topic Send  topic

Author Message
Peter Young
Posted: 12/20/2003, 7:46 AM

How to do the followig operation?

I have textbox and listbox, both are reading and placing data into the same
database field but textbox is used when listbox has no listed value (the
data for listbox are taken from destination database field by using SQL
command SELECT DISTINCT...).

My question is howto force CCS22 to read from one field or another on
condition: read from listbox when textbox is empty or read textbox if
listbox has not selecetd value ?

Where I shoud place the procedure (in PHP) to swap to fields values by usinf
GetValue and SetValue ?

I hope my question is enough clear, I'm using PHP and MySQL database.

regards,
Peter

Misha Peric
Posted: 12/21/2003, 4:46 AM

I have one quite simple solution, hope it will be enough.

Make a regular Record form and for field in question use textbox (TextBox1).

Near this textbox insert new listbox control. Setup this listbox so it uses
SQL as a data source type and use something like this: "SELECT DISTINCT
field1 FROM table1"

Now add a client action to this listbox in "Change" event, choose "Custom
Code".

Insert something like this:

document.forms["users1"].TextBox1.value =
document.forms["users1"].ListBox1.value;

Now whenever the value is chosen from the list box it's automatically
inserted into textbox, and textbox value is submitted. Voila!

Misha Peric



"Peter Young" <sarneckpNOSMAP@netscape.net> wrote in message
news:bs1qse$utk$1@news.codecharge.com...
> How to do the followig operation?
>
> I have textbox and listbox, both are reading and placing data into the
same
> database field but textbox is used when listbox has no listed value (the
> data for listbox are taken from destination database field by using SQL
> command SELECT DISTINCT...).
>
> My question is howto force CCS22 to read from one field or another on
> condition: read from listbox when textbox is empty or read textbox if
> listbox has not selecetd value ?
>
> Where I shoud place the procedure (in PHP) to swap to fields values by
usinf
> GetValue and SetValue ?
>
> I hope my question is enough clear, I'm using PHP and MySQL database.
>
> regards,
> Peter
>
>




   


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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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