missing ) after argument list

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hariomt
    New Member
    • Jan 2009
    • 10

    missing ) after argument list

    Hi,
    i have to create table's rows dynamically.
    I am using bellow code snipet...

    Code:
    function copySelectedAttr()
        {
            
              var attrValue= document.getElementById('fromEntityAttrBox').options[document.getElementById('fromEntityAttrBox').selectedIndex].text;
    		var attrtype=document.getElementById('fromEntityAttrBox').value;
    	  var newRow = document.getElementById("tlbEntityAttr").insertRow(rowIndex);
                   var oCell = newRow.insertCell(0);
                   oCell.innerHTML = "<input type='text' name='t' value='"+attrValue+"'/>";
                   oCell = newRow.insertCell(1);
    			   alert("asdsdwf"+attrValue)
                   oCell.innerHTML = "<input type='button' name='attrbutton' value='..' onclick='showValues("+attrValue+","+attrtype+");'/>";
    
              rowIndex=rowIndex+1; 
               
              
        }
    It inserts rows as needed.
    But when I click on button it throws error message on firefox saying missing ) after argument list. ie
    Error: missing ) after argument list
    Source File: http://localhost:8080/portletdriver/dt
    Line: 1, Column: 20
    Source Code:
    showValues(Cust omer Type:cum,Single );
    please help.
    Last edited by gits; Jan 25 '09, 11:02 AM. Reason: added code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    The values need to be quoted, e.g.
    Code:
    showValues('Customer Type:cum','Single');

    Comment

    Working...