Advertisement

08.16.2008 at 04:58AM PDT, ID: 23653363
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

ComboBox ASP + Javascript

Asked by guiaragaoreis in Active Server Pages (ASP), Politics, JScript

Tags: ,

I don't understand why don't work.

Can anyone help me?

Thanks,
Gui Reis


<!-- #include virtual="/conteudos/incSystem.asp"-->
<%
set conn=server.createobject("ADODB.Connection")
conn.open connection
%>

<html>
<head>
<title>Populate Select Options</title>
</head>

<body>



<script language=Javascript>
<%
   Dim count
   Dim DistID
   Dim DistTXT
   count = 0
   SQL = "SELECT dist_code, dist_descricao FROM bvu_distrito"
   set rs = Conn.Execute(SQL)
   Do Until rs.eof
      if count = 0 then
         DistID = rs("dist_code")
         DistTXT = chr(34) & rs("dist_descricao") & chr(34)
         
      else
         DistID = rs("dist_code") & "," & DistID
         DistTXT = chr(34) & rs("dist_descricao") & chr(34) & "," & DistTXT
      end if
      count = count + 1
      rs.movenext
   Loop
   DistID = DistID & ",-1"
   DistTXT = DistTXT & ",-1"
   rs.close
   set rs = nothing

%>
// now populate the Javascript variables
var ArrayDistID = new Array(<%=DistID%>);
var ArrayDistTXT = new Array(<%=DistTXT%>);
// now show them so you know this works!
alert(ArrayDistID + '\n' + ArrayDistTXT);
</script>

<script language="javascript">
function ManageStates(value)
{
      var disp = "block";
      if (value.match ("USA") == null){
            disp = "none";
      }
      var states = document.MyForm.Conuntry_States;
      if (states != null) {
            states.style.display = disp;
      }
}
function ManageList (value) {
      var USAStateList = new Array('FL', 'NY', 'CA');
      var CANStateList = new Array('Can_State1', 'Can_state2');
      var UKRStateList = null;

      var stateList    = null;
      //
      // Clean the current list
      //
      for (var i=0; i < document.MyForm.Conuntry_States.length; i++)
      {
                  document.MyForm.Conuntry_States.options[i]=null;
      }

      document.MyForm.Conuntry_States.length = 0;
      //
      // Evaluate and assign the list
      //
      if (value.match ("USA") != null) {
            stateList = USAStateList;
      }
      if (value.match ("CAN") !=  null) {
            stateList = CANStateList;
      }
      if (value.match ("UKR") != null) {
            stateList = UKRStateList;
      }

      //
      // Update the Option Value, Text, Length and Display
      //
      if (stateList != null) {
            for (var j=0; j < stateList.length; j++)
            {
                  //alert (" State " + stateList[j]);
                  eval ("var optionText"+j+" = new Option(stateList[j])")
                  eval ("var optionValue"+j+" = stateList[j]")
                  eval ("document.MyForm.Conuntry_States.options[j] = optionText" + j)
                  eval ("document.MyForm.Conuntry_States.options[j].value = optionValue" + j)
            }
            document.MyForm.Conuntry_States.length = stateList.length;
            document.MyForm.Conuntry_States.style.display = "block";
      }
      else {
            document.MyForm.Conuntry_States.style.display = "none";
      }
}
</script>










<form name="MyForm">
      <table>
      <tr>
            <th align="left">
      <select name="Country"  onChange="ManageList(document.MyForm.Country.value);">
            <option value="CAN">Canada</option>
            <option value="UKR">Ukraine</option>
            <option value="USA" selected>United States of America</option>
      </select>
            </th>
      </tr>
      <tr>
            <th align="left">
      <select name="Conuntry_States">
            <option value="FL">Florida</option>
            <option value="CA">California</option>
            <option value="NY">New York</option>
      </select>
            </th>
      </tr>
      </table>
</form>
</body>
</html>
Start Free Trial
 
Loading Advertisement...
 
[+][-]08.16.2008 at 05:05AM PDT, ID: 22243867

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.16.2008 at 05:37AM PDT, ID: 22243921

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.16.2008 at 05:38AM PDT, ID: 22243928

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.16.2008 at 06:19AM PDT, ID: 22244000

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.16.2008 at 09:14AM PDT, ID: 22244434

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.16.2008 at 10:28AM PDT, ID: 22244606

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.16.2008 at 10:29AM PDT, ID: 22244607

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.16.2008 at 10:57AM PDT, ID: 22244707

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.16.2008 at 11:01AM PDT, ID: 22244723

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.16.2008 at 12:41PM PDT, ID: 22244985

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), Politics, JScript
Tags: ASP , Javascript, IE7
Sign Up Now!
Solution Provided By: hielo
Participating Experts: 2
Solution Grade: A
 
 
[+][-]08.16.2008 at 03:26PM PDT, ID: 22245384

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.16.2008 at 03:35PM PDT, ID: 22245408

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628