Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting NaN with Javascript variable

blue72TAAug 12 2011 — edited Aug 12 2011
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
This post has been answered by Joel_C on Aug 12 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 9 2011
Added on Aug 12 2011
6 comments
723 views