Steve,
Thanks it's working like a charm only two problems I see in your code one
<@ROWS ARRAY="Local$CompanyArray">
> CompanyArray[<@CALC EXPR="<@CURROW>-1">]= new Object();
> CompanyArray[<@CALC EXPR="<@CURROW>-1">].length=<@NUMCOLS
> ARRAY="Local$CompanyArray">;
> <@COLS>
> CompanyArray[<@CALC EXPR="<@CURROW>-1">].<@VAR
> ** Local$ContactArray[0,<@CURCOL>]>= '<@VAR
> Local$CompanyArray[<@CURROW>,<@CURCOL>]>'
> </@COLS>
First: The above ** should be CompanyArray not ContactArray.
Second: You need to have the top menu say "Select" or something like that.
If the user selects the top choice it does not spawn the population of the
child menu. Hence, I added **.
function PopulateTypeList(FormName,SelectName,Code)
{
ClearList(FormName,SelectName);
**var option=document.createElement("OPTION");
**option.text="Select";
**option.value="N/A";
**document.forms[FormName].elements[SelectName].add(option);
for(i=0;i<TypeArray.length;i++)
if(SelectArray[i].TypeCode==Code)
AddTypeListOption(FormName,SelectName,TypeArray[i]);
}
Jose
on 8/13/2002 12:13 PM, Steve Smith at [EMAIL PROTECTED] wrote:
> I've got the following to work with assistance from Gauthier. If anyone can
> point out to me how to add additional fields so that I can display both
> first and last name, I'd appreciate it. This uses two arrays that are built
> with searches and stored to @@user$ua_company and @@user$ua_contact in
> earlier searches. I've also attached a copy of the taf file that I have
> working.
>
> <@ASSIGN Local$CompanyArray @@user$ua_company>
> <@ASSIGN Local$CompanyArray[0,*] <@ARRAY VALUE="CompanyId,CompanyName;">>
> <@ASSIGN Local$ContactArray @@user$ua_contact>
> <@ASSIGN Local$ContactArray[0,*] <@ARRAY
> VALUE="ContactId,FirstName,LastName,CompanyId;">>
>
> <form name="SelectContact" action="<@CGI><@APPFILE>?_function=test">
> <select name="CompanyId"
> onchange="PopulateContactList('SelectContact','ContactId',this.value);">
> <@ROWS ARRAY="Local$CompanyArray">
> <option value="<@VAR Local$CompanyArray[<@CURROW>,CompanyId]>">
> <@VAR Local$CompanyArray[<@CURROW>,CompanyName]>
> </option>
> </@ROWS>
> </select>
>
> <select name="ContactId">
> </select>
> <INPUT TYPE=SUBMIT NAME="Submit" VALUE="Submit">
> </form>
>
> <script>
> var ContactArray=new Array();
> var CompanyArray=new Array();
> <@ROWS ARRAY="Local$ContactArray">
> ContactArray[<@CALC EXPR="<@CURROW>-1">]= new Object();
> ContactArray[<@CALC EXPR="<@CURROW>-1">].length=<@NUMCOLS
> ARRAY="Local$ContactArray">;
> <@COLS>
> ContactArray[<@CALC EXPR="<@CURROW>-1">].<@VAR
> Local$ContactArray[0,<@CURCOL>]>= '<@VAR
> Local$ContactArray[<@CURROW>,<@CURCOL>]>'
> </@COLS>
> </@ROWS>
>
> <@ROWS ARRAY="Local$CompanyArray">
> CompanyArray[<@CALC EXPR="<@CURROW>-1">]= new Object();
> CompanyArray[<@CALC EXPR="<@CURROW>-1">].length=<@NUMCOLS
> ARRAY="Local$CompanyArray">;
> <@COLS>
> CompanyArray[<@CALC EXPR="<@CURROW>-1">].<@VAR
> Local$ContactArray[0,<@CURCOL>]>= '<@VAR
> Local$CompanyArray[<@CURROW>,<@CURCOL>]>'
> </@COLS>
> </@ROWS>
> function PopulateContactList(FormName,SelectName,CompanyId)
> {
> ClearList(FormName,SelectName);
> for(i=0;i<ContactArray.length;i++)
> if(ContactArray[i].CompanyId==CompanyId)
> AddContactListOption(FormName,SelectName,ContactArray[i]);
> }
> function AddContactListOption(FormName,SelectName,ContactStructure)
> {
> var option=document.createElement("OPTION");
> option.text=ContactStructure.FirstName;
> option.text=ContactStructure.LastName;
> option.value=ContactStructure.ContactId;
> document.forms[FormName].elements[SelectName].add(option);
> }
> function ClearList(FormName,SelectName)
> {
> while(document.forms[FormName].elements[SelectName].length)
> document.forms[FormName].elements[SelectName].remove(0);
> }
> PopulateContactList('SelectContact','ContactId','<@VAR
> Local$CompanyArray[1,CompanyId]>');
> </script>
>
>
>
> <@assign local$scopeArray <@array value="Local;">>
> <style type="text/css">
> body {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
> font-size: 10px;}
> span.tab, span.tabOn, span.tabOff {border:1px solid #000; cursor:pointer;
> line-height:15px;}
> span.tabOn, .debugVarTable td.on {background-color:#369; color:#FFF;}
> span.tabOff, .debugVarTable td.off {background-color:#FFF; color:#369;}
> .tabGrp {width:30%;}
> #tabContent{ overflow:scroll; overflow-x:hidden ; height:200px;border:1px
> solid #369;}
> .debugVarTable td { border:1px solid #000;}
> #varContent {border:4px dashed #336699;}
> </style>
>
> Steve Smith
>
> Skadt Information Solutions
> Office: (519) 624-4388
> GTA: (416) 606-3885
> Fax: (519) 624-3353
> Cell: (416) 606-3885
> Email: [EMAIL PROTECTED]
> Web: http://www.skadt.com
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Jose Kuhn
> Sent: August 13, 2002 11:19 AM
> To: Multiple recipients of list witango-talk
> Subject: Witango-Talk: Thanks for help!! and one more thing
>
>
> Thanks for the help on the dynamic menu stuff I am hip deep into!!! Can
> anyone point me to a good javascript resource that could teach me how to
> program the following.
>
> If I change a value on Menu-A then the options for menu b changes.
>
>
> Thanks
>
> Jose
>
> --
> Webologies
> 150 Robinette Drive
> Waynesville, NC 28786
> 828.627.1994
>
> http://www.webologies.com
>
>
> ----------------------------------------------------------------------------
> Rocket J Squirrel "Captain Peachfuzz has suddenly turned stupid"
> Bullwinkle J Moose "That wasn't a turn, it was more of a slight veer"
> ----------------------------------------------------------------------------
>
>
> ________________________________________________________________________
> TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
> with unsubscribe witango-talk in the message body
>
--
Webologies
150 Robinette Drive
Waynesville, NC 28786
828.627.1994
http://www.webologies.com
----------------------------------------------------------------------------
"You can't make an omelet without breaking eggs" Boris Badenov
----------------------------------------------------------------------------
________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
with unsubscribe witango-talk in the message body