Welcome Guest, Not a member yet? Register   Sign In
getElemntbyid returns undefined value

(This post was last modified: 08-28-2018, 12:36 AM by kvanaraj.)

(08-27-2018, 11:36 PM)Vitaly83 Wrote:
(08-27-2018, 01:49 AM)kvanaraj Wrote: var txtSecondNumberValue = document.getElementById('texttwo_'+rowid).value;
return indefined value in javascript. but in the POST values working . need suggestion

Display 'texttwo_'+rowid result and check if this element exists. Using of jQuery and other libs will not help if the element with this ID is not exists.

Just call console.log('texttwo_'+rowid) before call document.getElementById to check what element you try to get.

If document.getElementById returns null, then that element is not exists or hasn't created yet if it is a dynamical element.
It returns texttwo_1 or texttwo_2
Yes it's a dynamical element
it's a input type 
echo '<td id="texttwo_'.$row['id'].'"> 
  <input type="number" min="0" max="999" name="acr"  
  onChange="sum('.$row['id'].');" class="txtbox"  ></td>';
It is a muliple  row. each row has different value that should be calculated based on this second row

Messages In This Thread
RE: getElemntbyid returns undefined value - by kvanaraj - 08-28-2018, 12:21 AM

Theme © iAndrew 2016 - Forum software by © MyBB