close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Populating a multiple dropdowns

Thread began 8/10/2011 3:33 pm by rogersds267040 | Last modified 8/16/2011 9:13 am by Jason Byrnes | 2262 views | 5 replies |

rogersds267040

Populating a multiple dropdowns

My previous question is below. I was told to purchase Dynamic Dropdown to accomplish this task. Followed the instructions but when I select a customer from the Parent Dropdown, the Child dropdown isn't getting populated.



Is there a way in data assist when I select a customer from a dropdown list (Customer) that another dropdown(Contact) would be populated with contact information associated with that customer id?

Please see attachment.

Any assistance given will be appreciated.

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

there is no page attached to this.

please compress the php page to a zip archive and attach the zip file to your reply.

it would also be helpful to have a link where we can see this in the browser.

Sign in to reply to this post

rogersds267040

Populating a multiple dropdowns

Please see attachment.

You can also view the page at contracts_Insert.php under Customer Information.

When you select a customer, only contact information for that particular customer must showup in the Contact dropdown.

Attached Files
contracts_Insert.zip
Sign in to reply to this post

Jason ByrnesWebAssist

1) The recordset that is being used for the Dynamic Array, WADAsrcontact, is not returning any records, it relies on the customerid querysting variable to return records.

the dynamic array recordset needs to be able to return the customers and contact info.


2) you have added The Populate List from Array behavior to the onchange event of the contact list, it needs to be set to the onchange event of the customer list.

Sign in to reply to this post

rogersds267040

Populating a multiple dropdowns

Doesn't work, getting a blank screen.

Please see attachment.

Attached Files
contracts_Insert.zip
Sign in to reply to this post

Jason ByrnesWebAssist

when i test your link, the page is loading but not showing the main content area, this is because you have set the height for the cointent area to 1%.

in the admin.css file, change:

#outerWrapper #contentWrapper {
height: 1%;
min-height: 0;
padding-bottom: 10px;
padding-left: 0px;
padding-right:0px;
padding-top: 10px;
overflow: hidden;
}



to:

#outerWrapper #contentWrapper {
/*height: 1%;*/
min-height: 0;
padding-bottom: 10px;
padding-left: 0px;
padding-right:0px;
padding-top: 10px;
overflow: hidden;
}



you will also need to move the Create Dynamic array code from line 93 - 139:

php:
<?php

if ($row_WADAcontact)     {
  echo 
"<SC" "RIPT>\n";
  echo 
"var WAJA = new Array();\n";

  
$oldmainid 0;
  
$newmainid $row_WADAcontact["customerid"];
  if (
$oldmainid == $newmainid)    {
    
$oldmainid "";
  }
  
$n 0;
  while (
$row_WADAcontact)     {
    if (
$oldmainid != $newmainid)     {
      echo 
"WAJA[".$n."] = new Array();\n";
      echo 
"WAJA[".$n."][0] = '".WA_DD_Replace($newmainid)."';\n";
      
$m 1;
    }

    echo 
"WAJA[".$n."][".$m."] = new Array();\n";
    echo 
"WAJA[".$n."][".$m."][0] = "."'".WA_DD_Replace($row_WADAcontact["contactid"])."'".";\n";
    echo 
"WAJA[".$n."][".$m."][1] = "."'".WA_DD_Replace($row_WADAcontact["contfname"])."'".";\n";

    
$m++;
    if (
$oldmainid == 0)      {
      
$oldmainid $newmainid;
    }
    
$oldmainid $newmainid;
    
$row_WADAcontact mysql_fetch_assoc($WADAcontact);
    if (
$row_WADAcontact)     {
      
$newmainid $row_WADAcontact["customerid"];
    }
    if (
$oldmainid != $newmainid)     {
      
$n++;
    }
  }

  echo 
"var WADAcontact_WAJA = WAJA;\n";
  echo 
"WAJA = null;\n";
  echo 
"</SC" "RIPT>\n";
}
function 
WA_DD_Replace($startStr)  {
  
$startStr str_replace("'""|WA|"$startStr);
  
$startStr str_replace("\\""\\\\"$startStr);
  
$startStr preg_replace("/[\r\n]{1,}/"" "$startStr);
  return 
$startStr;
}
?>




to be just after the head instance editable tag:
<!-- InstanceBeginEditable name="head" -->

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...