By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,575 Members | 1,402 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,575 IT Pros & Developers. It's quick & easy.

missing ) after argument list

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

Expand|Select|Wrap|Line Numbers
  1. function copySelectedAttr()
  2.     {
  3.  
  4.           var attrValue= document.getElementById('fromEntityAttrBox').options[document.getElementById('fromEntityAttrBox').selectedIndex].text;
  5.         var attrtype=document.getElementById('fromEntityAttrBox').value;
  6.       var newRow = document.getElementById("tlbEntityAttr").insertRow(rowIndex);
  7.                var oCell = newRow.insertCell(0);
  8.                oCell.innerHTML = "<input type='text' name='t' value='"+attrValue+"'/>";
  9.                oCell = newRow.insertCell(1);
  10.                alert("asdsdwf"+attrValue)
  11.                oCell.innerHTML = "<input type='button' name='attrbutton' value='..' onclick='showValues("+attrValue+","+attrtype+");'/>";
  12.  
  13.           rowIndex=rowIndex+1; 
  14.  
  15.  
  16.     }
  17.  
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(Customer Type:cum,Single);
please help.
Jan 25 '09 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
The values need to be quoted, e.g.
Expand|Select|Wrap|Line Numbers
  1. showValues('Customer Type:cum','Single');
Jan 26 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.