This topic is locked

dependant lookup wizards

8/24/2007 12:36:01 PM
PHPRunner General questions
C
ccuser author

Hello All,
I have 2 lookup wizards on an add page. The second is dependant on the first.

I use the smarty->assign( ) in the AddonLoad function to default the value of the first drop down list.

That all works fine but then the second (dependant one ) does not populate with values.

In order to do that I have to unselect the defaulted value and chose another one then select it again.
My question is that is there a way to still have dependant drop downs function properly when defaulted their predecessors? Somehow the value of the first one needs to be POST on page load so that the second one can populate.

Also can this be done even if the first drop down is disabled?
Thanks for all your help!!

Sergey Kornilov admin 8/24/2007

I'm not sure why you need to assingn default values this way.
I would suggest to set default value in "Edit as" properties of the field.

C
ccuser author 8/24/2007

I'm not sure why you need to assingn default values this way.

I would suggest to set default value in "Edit as" properties of the field.


Well default is a poor choice of words on my part. Actually, I have the value of the search parameters "preselected" on the add pages.
So is there no way to do this? Is it possible to auto postback the value on page load, to force recognition?

C
ccuser author 8/27/2007

Has anyone tried something like this? Or found another way to accomplish the same task?
Thanks in advance!

Alexey admin 8/29/2007

Hi,
you can use Before SQL query event for this.

modify $strSQL to select a specified value instead of a field:

Change

select Field1, Field2, Field3...

to

select Field1, 'value' as Field2, Field3...

C
ccuser author 8/29/2007

Hi,

you can use Before SQL query event for this.

modify $strSQL to select a specified value instead of a field:

Change

to


Hi Alexey,
Thanks for the reply but I don't see how this would work?

I have one drop down that is independent that I have preselected via smarty->assign.

Then I want the second dependent dropdown to display the values that are linked to the first drop down, there can be more than one value
Thanks

Alexey admin 8/29/2007

Hi,
please ignore previous advice.
Put the smarty->assign( ) statement to your OnLoad event.

Then open your page in Visual Editor and switch to HTML mode.

Add this code to the end of the page:

<script>

document.forms.editform.value_Fieldname.onchange();

</script>

C
ccuser author 8/29/2007

Hi,

please ignore previous advice.
Put the smarty->assign( ) statement to your OnLoad event.

Then open your page in Visual Editor and switch to HTML mode.

Add this code to the end of the page:


THANKS!!!

Works perfectly!