Hello All,
I'm learning javascript and I'm having a problem. I can't seem to use a variable correctly in javascript. The function below shows the problem. When I use the vRow variable my value gets set, however when I try to use link_line variable I get NaN in my tabular field (f37).
Can anyone spot the problem here? I've tried everything including parseInt, parseFloat conversions but I can't figure out what's wrong.
Thanks for your help!
<script>
function f_ValidateLinkLine(pThis) {
// The row in the table
var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
// A value entered by user in tabular form on this row
var link_line = parseInt(html_GetElement('f20_'+vRow).value);
// Set the value for f37
// This works!
html_GetElement('f37_'+vRow).value = parseFloat(html_GetElement('f01_'+vRow).value);
// This puts NaN in my field! Why?
html_GetElement('f37_'+vRow).value = parseFloat(html_GetElement('f01_'+link_line).value);
} // End ValidateLinkLine
</script>
Edited by: blue72TA on Aug 12, 2011 12:09 AM