469,323 Members | 1,496 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

missing ) after argument list

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
1 1356
acoder
16,027 Expert Mod 8TB
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.

Similar topics

4 posts views Thread by Conrad Weyns | last post: by
1 post views Thread by soup_or_power | last post: by
77 posts views Thread by Ville Vainio | last post: by
5 posts views Thread by Vv_vV | last post: by
1 post views Thread by salimbouiche | last post: by
4 posts views Thread by Pasquale | last post: by
8 posts views Thread by A. Anderson | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.