Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Dropdown menu help in add row script

Avatar of gifford_c
gifford_c asked on
3 Comments1 Solution253 ViewsLast Modified:
I using the code below and the dropdown menu works fine for the database populated dropdown list.  What I want if when I click Add it creates the database populated list again.  If I move the asp script into the line item(0).childNodes[1].innerHTML = "<SELECT SIZE=1 NAME=phone" + ind + "></SELECT>" and remove all the " for ' nothing happens.  Can someone help?

Dim cnOsmitDatabase
<script language="javascript">
function addRow(tbl){
 var tb = tbl.firstChild;
 var ind = tb.childNodes.length;
 var nr = document.getElementById('cloneThis').cloneNode(true);
 nr.style.display = "block";
   item(0).childNodes[1].innerHTML = "<SELECT SIZE=1 NAME=phone" + ind + "></SELECT>"
 if (tbl.rows.length > 1) {
   document.getElementById('delRow').disabled = false;
 document.forms[0].count.value = ind + 1;

function deletRow(tbl){
  if (tbl.rows.length > 1) {
    tblRow = tbl.deleteRow(tbl.rows.length-1);
    //           alert(tbl.rows.length);
function disablit(tbl){
  if(tbl.rows.length == 1) {
    document.getElementById('delRow').disabled = true;
<!-- #INCLUDE FILE="dbconnection/connect.asp" -->
  count = request.form("count")
  for i = 0 to cint(count) - 1
    phone = request.form("phone" & i)
    response.write "phone = " & phone & "<br>"
<form name="addAccount" method="post" >

      Dim rsHWProdCat
      Dim rsSWProdCat
      Dim strSQL
      Set rsSWProdCat1 = Server.CreateObject("ADODB.RecordSet")

      ' SQL to get the software titles.
      strSQL = "SELECT * FROM software WHERE (([StdBuildComponent] = FALSE) AND ([Status] = 'Approved')) ORDER BY [Software Title] ASC;"
      rsSWProdCat1.Open strSQL, cnOsmitDatabase
<input type=hidden name="count" value="1">
<table id="purchase">
<tr id='cloneThis'>
<table border=0>
<td colspan=5><SELECT SIZE="1" NAME="phone0">
          if Not rsSWProdCat1.EOF Then
      Do While Not rsSWProdCat1.EOF
      Response.Write "<option value=" & chr(34) & rsSWProdCat1.Fields("Software Title") & " " & rsSWProdCat1.Fields("Version") & CHR(34) & ">" & rsSWProdCat1.Fields("Software Title") & " " & rsSWProdCat1.Fields("Version") & "</option>"
      end if
      Set rsSWProdCat1 = Nothing
<input type=button onclick="addRow(document.getElementById('purchase'))" value="Add">
<input type=button id="delRow" name="delRow" onclick="deletRow(document.getElementById('purchase'));disablit(addContact);" value="Delete" disabled>
<input type="submit" value="submit">
Avatar of lil_puffball
lil_puffballFlag of Canada image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answers