[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 557
  • Last Modified:

Add label to table cell

I have an HTML table.
The below code is attempting to add a <p> tag to act as a label to show the results of the ajax call.   My attempt is to do the following steps:
1.  identify the parent of the current field, which should be the <td>.
2. Add a <p> to the <td> as a child
3. Populate the <p>

How can I add the label.  I need to keep it dynamic.

here is the err:
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 1.1.4322)
Timestamp: Sat, 2 Jan 2010 15:20:49 UTC


Message: Type mismatch.

Line: 1063
Char: 3
Code: 0
URI: http://7iprod/ifas7/workflow/custom/SUTTERPPF/common/wfcommon.js


if(id.indexOf("glkey") > -1)
	{
		
	var glkey = document.getElementById(id).value
		
	       xmlhttpPost("SUTTERPPF/common/wfbdrvgljukeyobj.asp", "mode=getglkey&glkey=" + glkey)
		var parent = document.getElementById(id).parentNode
		label = parent.appendChild("p") 
		label.innerHTML = responseVal
	}

Open in new window

0
KeithMcElroy
Asked:
KeithMcElroy
1 Solution
 
leakim971PluritechnicianCommented:
Hello KeithMcElroy,

What's line 1063 in the code snipet ?

Regards
0
 
kadabaCommented:
here s the revised code.

if(id.indexOf("glkey") > -1)
{
	var glkey = document.getElementById(id).value;
	xmlhttpPost("SUTTERPPF/common/wfbdrvgljukeyobj.asp", "mode=getglkey&glkey=" + glkey);
	var parent = document.getElementById(id).parentNode;
	var label = document.createElement("p");
	label.innerHTML = responseVal;
	parent.appendChild(label); 
}

Open in new window

0
 
KeithMcElroyAuthor Commented:
fabulous!
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now