Hi,

there seem to be nothing wrong with that code apart from the "'id=' +
this.options[this.selectedindex].value". change that to
"'id=' + this.options[this.selectedIndex].value" or "'id=' + this.value"
and all should be well...

/Zosimov

shannon.patterson skrev:
> i'm trying to do the exact same thing and am experiencing the same
> issues as you are.
>
> On Nov 26, 10:06 am, "[EMAIL PROTECTED]"
> <[EMAIL PROTECTED]> wrote:
>   
>> Hi all,
>> my problem is occurring with creating a dropdown box that when
>> selected, AJAX will place another dropdown box below it filled with
>> choices according to the value chosen in box 1.
>>
>> I use the following code to generate the first dropdown box:
>>
>> <?php
>> echo select_tag('department_choice', objects_for_select($depts,
>> 'getName', 'getName'),
>> array( 'onchange' => remote_function( array(
>>
>> 'update' => 'classSelection',
>> 'url' => 'departments/GetCourses',
>> 'with' => "'id=' + this.options[this.selectedindex].value",
>> 'loading' => "Element.show('indicator')",
>> 'complete' => "Element.hide('indicator')"
>>                       )    )
>>          ));
>> ?>
>>
>> <div id="classSelection">
>> </div>
>>
>> executeGetCourses in action.class.php, which will take the value from
>> Box 1 and retrieve only the values from the CRN column of my 3 column
>> table that have the same Name column value as the id chosen:
>>
>> public function executeGetCourses()
>>         {
>>                 $CRNcrit = new Criteria();
>>
>>                 $CRNcrit -> clearSelectColumns();
>>                 $CRNcrit -> addSelectColumn( OfferedPeer::CRN );
>>
>>                 $CRNcrit->add( OfferedPeer::Name, $this-
>>
>>     
>>> getRequestParameter('id') );
>>>       
>>                 $this->crns = OfferedPeer::doSelect( $deptCrns );
>>
>> }
>>
>> and this is getCoursesSuccess.php:
>>
>> <?php
>> use_helper('Object');
>>
>> echo select_tag( 'classes',  objects_for_select($crns, 'getCRN',
>> 'getCRN') );
>> ?>
>>
>> Is there anything wrong with this code, because when i execute it in
>> my web page, nothing happens when i choose an option in box 1?
>>     
> >
>
>
>   

-- 
*******************************************
Håkan Eriksson
Carmona AB
Storgatan 24
302 43 Halmstad 
035-188807
0708-539908
[EMAIL PROTECTED]
*******************************************



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

begin:vcard
fn;quoted-printable:H=C3=A5kan Eriksson
n;quoted-printable:Eriksson;H=C3=A5kan
org:Carmona AB
adr:;;Storgatan 24;Halmstad;;30243;Sverige
email;internet:[EMAIL PROTECTED]
title:Utvecklare
tel;work:035-188807
tel;cell:0708-539908
x-mozilla-html:TRUE
url:http://www.carmona.se
version:2.1
end:vcard

Reply via email to