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

 Dependent List Boxes

Print topic Send  topic

Author Message
Sean
Posted: 01/07/2004, 7:01 AM

Has anyone found a solution to this? I tried the example on the CodeCharge website, but I am still having problems.

My project background: (ASP, Access 2000, CCS 2.2)
I have a grid form that has customer information. When I click the customer name (referenced by CustomerID), it takes me to an update form where I can change the information. In this update form is; First Name, Last Name, Address, Phone, etc, plus Make and Model (for what type of automobile they own). The Make and Model labels are actually list boxes. Model is (or
should be) dependent upon the Make value in the first list box.

Ex. When I select "Ford", the second list box should populate only Ford Vehicles.

When I select my first list box, the screen refreshes and the second populates with the desired data, but then the first list box does not keep it's original value. It returns to "Select Value" status.

Also, since the screen refreshes, it takes out the CustomerID parameter that I need in the address bar (CustomerID=###). Without this, I cannot make the change to the record that I am trying to make.

Can I get this done without refreshing? I don't mind the additional trips to the server. Or, if it has to refresh, how can I keep the needed parameter?

I will provide any additional info if needed.

Thanks.
PetrP


Posts: 25
Posted: 01/07/2004, 12:35 PM

This link takes you to what you want:

http://www.learnasp.com/learn/listdynamicdb.asp
View profile  Send private message
rbaldwin
Posted: 01/07/2004, 1:01 PM

http://www.tneoh.zoneit.com/javascript/dynalistbox.txt
susan
Posted: 07/30/2004, 7:04 AM

This is exactly what I am trying to do - but I am lost - can't seem to get my second listbox to be dependant on the first - the links in the reply above are not valid so I would BE grateful for any assistance!

thanks,

Susan
dataobjx


Posts: 181
Posted: 07/30/2004, 7:24 AM

Here's another way;

Add this script before the </head> section

<SCRIPT LANGUAGE = "JavaScript">
function GetModel(form)
{
selMake = form.MakeListBox.value;
page = "MyPage.asp?ReturnMake=" + selMake;
window.location=page
}
</SCRIPT>


Add this onChange() to your listbox <select> line....

<select name="MakeListBox" onChange="GetModel(this.form); return true">

Now, when the user selects the value from the MakeListBox, the page will refresh with ?ReturnMake=12 (make_id) in the address line (url).

Then, the second listbox needs to have a query where clause added to filter on the ReturnMake value.
_________________
www.DataObjx.net
www.mydigitalapps.com
View profile  Send private message
DaveRexel

Posts: 50
Posted: 07/30/2004, 8:44 AM

::
This how-to by Walter Kempees may help :

http://forums.codecharge.com/posts.php?post_id=49888
_________________
/Dave
RexDesign CodeCharge Studio Tutorials
http://rexdesign.com/ccs/
View profile  Send private message
Walter Kempees
Posted: 08/02/2004, 11:51 AM

Thanks to Dave for pointing to the How-to.
The How to is based on a search and Grid combination.
For a Insert/Update RecordForm, set at least a field to 'required' and give
it an errorstate, (set it to an incorrect value).
Have the listbox set a submitform() action onchange.
The first listbox will, after the user selects a values set this value in
your screen/record buffer, then it will submit the form.
The next listbox should take its where clause from the first listbox'target
field.
and so on.
If the lists are 'reguired'than the form will eventually be submitted and
updte or insert the record.
To prevent this from happening too soon, in case all fields after the
listboxes are not required, set a dummy required field and set that to a
correct value when your last box is filled.

Besides searching the forum for listbox should also result in a nice article
about filling listboxes (with large datasets) the Java way, before any
submitting goes one, saving server access and submits.
Also the CCS examples contain a listbox in popup primed by a entry on a
form, nice reading too.

Walter Kempees,
Willing to help susan with hands-on assistance, if needed mail me.

"susan" <susan@forum.codecharge> schreef in bericht
news:6410a5556acaf9@news.codecharge.com...
> This is exactly what I am trying to do - but I am lost - can't seem to get
my
> second listbox to be dependant on the first - the links in the reply above
are
> not valid so I would BE grateful for any assistance!
>
> thanks,
>
> Susan
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Alberto Pacheco
Posted: 08/05/2004, 4:10 PM

On the first list box use the default value property with the following code:
CCGetParam("s_Kcopro",Empty)

where s_Kcopro is the name of the url parameter.

Its works for me.

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.