i have to create table's rows dynamically.
I am using bellow code snipet...
Expand|Select|Wrap|Line Numbers
- 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;
- }
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.