Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

<h:outputText not found as form element question

Dan MacLeod
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a <hutputText element that I'd like to update the value from javascript. However the element is not found in the form. I can access all the other form elements, just not <hutputText elements. Does anyone know how to get around this? The code is running in a portlet on WLP 10.3.2, Code snippets below:

<h:form id="updaterForm">
<h:panelGroup layout="block" id="pg_geoWrapper">
<table id="t_geoFields">
<tr><td><hutputText id="ot_geoStatus" value="Status:"/></td></tr>

When a button is clicked the javascript is called

function displayProperComponents(myForm) {
var statusLabelId = null;

for(i=0; i<myForm.elements.length; i++) {
if (myForm.elements[i].id.indexOf("ot_geoStatus")>=0){
statusLabelId = myForm.elements[i].id;

if (document.getElementById(statusLabelId) != null){
document.getElementById(statusLabelId).innerHTML = '';
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic