dhodgdon
Posts: 80
|
| Posted: 07/27/2004, 6:28 AM |
|
I have two list boxes A & B in a form. If the user changes the value in A I want to immediately change the value of B to match it.
Everything I read in CCS help indicates that this can be done using a Client -- On Change event. However, it appears that it can only be coded in HTML which I don't know other than some formatting commands.
1 -- Does anyone have any, (or know where to find), example code I can work from?
2 -- Can it be done in Visual Basic somehow? I can manipulate the values in VB but only after the form is submitted.
_________________
Regards,
David Hodgdon
|
 |
 |
Walter Kempees
|
| Posted: 07/27/2004, 7:23 AM |
|
I don't do ASP but in the codecharge.php forum I just responded to two
similar questions.
search for "HOWTO dependant listboxes" and "registration form"
Probably you solve your problem like this, but make up your own ASP code.
In design mode on your page, click the first list box, go to properties, in
the events tab, client side, onchange add action [submit form].
This will cause your form to update.
for the second listbox, set de sql to be dependend on the value of the field
where you stored the value for listbox1.
This should not need the action set, i think.
Walter
"dhodgdon" <dhodgdon@forum.codecharge> schreef in bericht
news:6410658965eb03@news.codecharge.com...
> I have two list boxes A & B in a form. If the user changes the value in A
I
> want to immediately change the value of B to match it.
>
> Everything I read in CCS help indicates that this can be done using a
Client
> -- On Change event. However, it appears that it can only be coded in HTML
> which I don't know other than some formatting commands.
>
> 1 -- Does anyone have any, (or know where to find), example code I can
work
> from?
>
> 2 -- Can it be done in Visual Basic somehow? I can manipulate the values
in VB
> but only after the form is submitted.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
Robert Rodgers
|
| Posted: 07/27/2004, 7:49 AM |
|
http://www.sylvancomputing.com/ccs/deplist/default.asp
Here is an example that I pulled from a project I worked on. I like this method because it doesn't refresh the entire page
each time the list changes and for large sets of data you don't need to download all the data.
Rob
"dhodgdon" <dhodgdon@forum.codecharge> wrote in messagenews:6410658965eb03@news.codecharge.com...
> I have two list boxes A & B in a form. If the user changes the value in A I
> want to immediately change the value of B to match it.
>
> Everything I read in CCS help indicates that this can be done using a Client
> -- On Change event. However, it appears that it can only be coded in HTML
> which I don't know other than some formatting commands.
>
> 1 -- Does anyone have any, (or know where to find), example code I can work
> from?
>
> 2 -- Can it be done in Visual Basic somehow? I can manipulate the values in VB
> but only after the form is submitted.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
dhodgdon
Posts: 80
|
| Posted: 07/27/2004, 10:28 PM |
|
I went to your site Rob and it was quite an education for this beginning programmer. For what I wanted to do, I decided to work from page: http://www.atgconsulting.com/doublelist.asp
Since all I want to do is set one list equal to another without submitting the form I picked code from the fill the box example and put it in the client side change event of the first listbox. The code errors out when the page loads and, not knowing much about Java, I don't know why and the error code returned does not help. Here is the code I entered:
<SCRIPT LANGUAGE="JavaScript">
function fillcombo(){
document.Courses.VideoB.options =
new Option(document.courses.VideoAB.options, document.courses.VideoAB.options);
}
</SCRIPT>
my page is Courses
The first listbox is VideoAB
The second listbox is VideoB
_________________
Regards,
David Hodgdon
|
 |
 |
|