Get NaN with the Javascript variable

Hi all

I'm learning javascript and I'm having a problem. I can't use a variable in javascript correctly. The function below shows the problem. When I use the variable vRow gets my value, however when I try to use the link_line variable I get NaN in my field in a table (f37).

Can someone identify the problem here? I tried everything, including parseInt, parseFloat conversions, but I can't understand what is 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>
Published by: blue72TA on August 12, 2011 12:09 AM

Hmmm... Is it possible that it's to do with the naming convention for item IDs tabular?

I have the feeling that the reason why your call to

alert( html_GetElement('f01_'+link_line).value )

Returns "undefined" is perhaps because the item you are looking for is actually called something like:

F01_0001

So if you simply concatenate F01_1, of course I don't think he'll find something with this specific ID (even if from a semantic point of view, that's what you intend). Try the same test, except F01_0001 hardcode in his place, I think you'll probably have a more fruitful response.

Tags: Database

Similar Questions

  • Why do I get problems with the challenges of poker Facebook poker?

    Why do I get problems with the challenges on facebook poker? have reloaded JAVA.didn't work

    URL of affected sites

    http://

    I'm not sure what that requires the application of poker, but perhaps solutions in the article of problems with some Facebook games, cat and more will help

  • When I try and play games my computer crashes or I get BSOD with the error Stop: 0x000000F4.

    Hello, I recently built a computer and installed all the software, drivers and updates of windows that I needed. Go and try to play games, I can play for a little bit. Then my computer crashes or I get BSOD with the error Stop: 0x000000F4. Generally before that happens, Skype will plant give me a message that says "error disk i/o" If that helps. How can I fix this problem so that this error does not happen again? It happened several times. I tried to reinstall the CMOS battery on the motherboard. I have the latest firmware of my SSD and drivers for my card mother and graphics card. My specs are:

    Windows 7 x 64
    I7 - 4770 k
    ASUS Z87 - a
    Corsair Vengeance 8 GB 1600 Mhz
    Modular power supply Corsair HX750
    Liquid chillers H80i Corsair
    EVGA GTX Superclocked 760 ACX
    Samsung 840 120 GB SSD (boot disk; the games installed on it)

    Hello

    To help you, we will need files DMP to analyze what exactly happened at the time of the accident, etc.

    If you don't know where the DMP files, here's how to get to them:
    1. go to the Windows\Minidump folder.
    2 copy all the DMP files in the Minidump folder on your desktop and zip then those files.
    3 download the zip containing the files DMP to Skydrive or a Web hosting of your choice and paste in your answer.

    If you plan to use Skydrive, but do not know how to download it, please see the following:
    http://www.WikiHow.com/use-SkyDrive

    Please note that all "cleaner" such as TuneUp Utilities, CCleaner, etc., default will remove files DMP when using because of their place too.

    If your computer doesn't generate DMP files, follow these steps:

    1. start > type systemroot which should show the Windows folder, click it. Once inside this folder, make sure there is a Minidump folder created. If not, CTRL-SHIFT-N to create a new folder and name it Minidump.

    2. Windows key + key Pause. This should appear in the system. Click Advanced on the left system settings > advanced > performance > settings > advanced > make sure there is a check mark for "manage automatically the size of pagefile for all readers."

    3. Windows key + key Pause. This should appear in the system. Click Advanced on the left system settings > advanced > startup and Recovery > settings > failure > ensure there is a check mark next to "Write an event to the system log" > make sure that "automatically reboot" is unchecked.

    Ensure that the partial memory image is turned on and make sure the path is % SystemRoot%\Minidump.

    4. check that the viewers is ENABLED:

    Start > Search > type services.msc > on the name tab, search for Windows Error Reporting Service > if the service status is not started, then right-click and select start. Also to ensure that, under Startup Type set to automatic rather than manual. You can do this by right click, select properties and under general selection on 'Automatic' startup type and then click on apply.

    If you can not get into normal mode to do this, please do so via Safe Mode.

    Kind regards

    Patrick

  • Can I use the session with the presentation variable variable

    Hello

    I'm using a method join the variable session or repository with the presentation variable.

    I created a variable called 'VarPres' in obiee presentation I created a session with a new block of initialization variable and I made this request

    "{Select fullName from employees where idEmp=@{VarPres}.

    but when I called the session variable in obiee I got this error

    The session variable, NQ_SESSION. S_OBJ, has no definition of value

    Hello

    Does not allow a presentation in an init block variable, simply because there is no variable presentation.

    In general what you try to do probably will never work because of "timing" and is as a session variable.

    A session variable is set once per session, for once he put no exchange of value as the init block is not executed again. So, because of this you already can imagine that there is a problem in your logic, if you want to use a value set by the user in the front end to set the value of a session variable.

  • I can't get contact with the cloud

    I can't get contact with the cloud. The icon on my desktop is black and the wheel turn and turn and turn. What should I do?

    OK, great, I hope that the link of this thread (shown below) helps you then your situation. App does not open. Wheel of progress turn continuously

    http://helpx.Adobe.com/creative-cloud/KB/unknown-Server-Error-launching-cc.html

    Keep us informed.

  • Service request not getting associated with the Contact

    Hello

    We have an interface between the Web site of our company and Siebel On demand application, visitors can come to our Web site and submit a request by filling out a form with their contact information and their request. In turn, this creates a folder 'Contact' and a 'Request for Service' in the Application folder,

    'Contact', we used WSDL and v2.0 "Request for Service" WSDL as the webservice interface, we find that the Contacts and requests for services are created as that individual records, service demand does not get associated with the contact record is created?

    We are capture the following information under the heading "Contact".
    First name:
    First name:
    E-mail:
    Phone:
    Address:

    and the following information under the 'Service request'
    Product information:
    Object:
    Description:
    Type:
    Status:

    Should the specify us anything else under the Service request in the interface that will associate the Contact and "demand for services.

    Is it because in version 2.0, each object exist as separate nodes that we are facing this problem?
    This will be solved by using v1.0, is there a limitation any using v1.0, please specify

    You can call me if you need additional information

    Thanks and greetings
    Satish Kumar
    + 1-857-869-0239

    Hello

    When you create the Service request, make sure that you set the field "ContactId" so that the created contact is associated with the SR created.

    -John CRMIT

  • Help with the JavaScript for checkbox

    I am a newbie with Javascript and will have questions, get the selection of a checkbox on my form to change a calculation.

    I have a form that contains two drop-down lists, the result of these two boxes are multiplied together.  I can get it works fine.

    However, I also have a box that, when checked I want the calculation according to the drop-down lists duplicate.  I can't get that part to work!

    Can anyone provide the javascript code to activate this simple event?

    Any help is appreciated.

    Thank you.

    It should look like this:

    Get field values

    var v1 = combo1.value;

    var v2 = combo2.value;

    $ var = + v1 + v2;

    Get the value of the checkbox

    var v3 = getField("checkbox1").value;

    Calculate the value of this field based on the State of the checkbox

    V3 = Event.Value = "Off"? sum: 2 * sum;

    This last line is equivalent to the following five lines:

    If (v3 = 'Off') {}

    Event.Value = sum;

    } else {}

    Event.value = 2 * sum;

    }

  • Need help with the text variables

    I have a directory to which is more than 300 pages long.

    Each entry begins with a photo in a built-in framework shaped like a cat fall, followed by a space en dash and then the name, company, address, e-mail, etc.. Essentially, we have a photo hanging to the left and on the right information.

    The name is the last name in capital letters, first name and middle name propercase. I've defined a character style "Dict Head" and used in a paragraph style as style nested through 3 characters.

    Then, I defined a two text for the instance variable first and last instance on the page of the character style "Dict Head". I have a hyphen between the two variables (the goal is at the head of the race be "AAR - ABE," for example). The application, however, includes space en with three letters.

    I did a GREP search for space en with the applied character style and replaced it with himself, and < None > character style applied and which does not seem to get rid of. My current title looks like this " AAR - ABE." With invisible on I see the en space is still there.

    I deleted the text variables, exported a. File INX, opened soft and recreated the text variables and the spaces are still there.

    I'm open to suggestion.

    Ken

    It seems ID brings together up to three regular characters with which nesting style... (Okay - just tried and the original en-space is also considered to be a 'character' for this number of three.) No matter what... read more, please)

    You can not delete a character with your search and replace nested style. Try it - ID can be found but not change it to [anything].

    Possible workaround would be to not use the style nested to mark the names and put the character marker using a GREP search and replacement style.

  • Updated report with the javascript calculation

    Hi all

    I have an updated report updated when the user fills one column. I then need a simple multiplication based on the user filled in the column and another column to fill in the last column.

    I managed to do it using the JavaScript in the page header
    <script language="JavaScript" type="text/javascript">
    <!--
    function calcit(pThis)
    {
    var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);

    html_GetElement('f03_'+vRow).value = html_GetElement('f02_'+vRow).value * html_GetElement('f01_'+vRow).value;

    }
    //-->
    </script>
    F01 column is a value in a table based on SQL to create the report (AQLSCORE)
    F02 column is what the user fills out (AQLERRORS)
    F03 column is where the calculation is populated (AQLTOTAL)

    With the attribute of the element AQLERRORS = onchange = "additives (this); »

    The problem I have with the above is that it only works when f03 is a text field (that is, the user can change the value) I wish column not editable (the user should not be able to edit this field). If I do the column text display (saves the State) the calculation returns a NaN error.

    When I change the calculation of a * a + the return value 1undefined shows that the value of f01 is indefinite

    Demo app

    http://Apex.Oracle.com/pls/Apex/f?p=15328

    user name: demo
    password: demo

    There are 2 pages that where the calculation works, but with AQLSCORE as a text field, and another where he returned NaN but with AQLSCORE as display text (saved state)

    Any ideas how I can perform the calculation and protect the AQLSCORE of the user column

    Kind regards

    Alex

    Published by: user10942729 on July 30, 2010 08:12

    Take alook at the modifed JS in the header HTML

    The f01_000n elements are display (saves the State) so that they appear as follows in the HTML DOM.

    2
    

    To access the content, you will need to use innerHTML as the 'value' attribute is not in use here.

    BTW, for

    html_GetElement('f03_'+vRow).value 
    

    You can use the shortcut

    $x('f03_'+vRow).value 
    

    Kind regards.

  • For loops with the array variable

    I am using a loop for example with the name of the table in the select variable, but get a compilation error

    for current_aud_row in (select * from ' | table_name |' where...)


    table_name contains the name of the actual table

    I do that I get the name of the table as a parameter.
    Help, please!

    Excellent. Oracle APEX (Application Express) is a web IDE and RTS - it makes heavy use of DBMS_SQL to execute SQLs and restore these dynamically in the form of Web-based reports, or turn it into XML for graphical rendering using Flash software.

    DBMS_SQL is perhaps more complex (and only really necessary when it comes true dynamic SQL at all stages - including the result of SQL), but we must know how to use and apply. It is a valuable tool at times.

  • Select with the javascript function

    I need to create a purchase order that allows to calculate the cost of printing using one-sided or two-sided. My problem is that this code can use only the cost of single_side in the function. The function must use two side cost if "DUP" checkbox is disabled. What I read javascript does not provide a way to access the selection list as if it were a table. (Where I can identify what dimension of the table I would use). Is there another way to do this?

    < script type = "text/javascript" >
    total() function
    {
    var Field1 = document.getElementById("DUP").value;
    var Field2 = document.getElementById("COPIES").value;
    var field3 = document.getElementById("ORIG").value;
    Field4 var = document.form2.paperlist.value;
    sphere5 var = document.form2.paperlist.value;
    If (Field1! = "no")
    document.getElementById("mytotal").value = parseInt (field2) *.
    parseInt (field3) / 2 * parseFloat (field4);

    on the other
    document.getElementById("mytotal").value = parseInt (field2) *.
    parseInt (field3) * parseFloat (field5);

    }
    < /script >

    Select name = "paperlist" id = "paperlist" onchange = "total ()" > "
    < cfoutput query = "paperlist" >
    < option value = "#paperlist.single_side # #paperlist.two_side #" > #paperlist.descr #, #paperlist.single_side #, #paperlist.two_side # < / option >
    < / cfoutput >
    < / select >

    < input type = "checkbox" name = "DUP" id = "DUP" onchange = "total ()" accesskey = "3" tabindex = "3" > "
    < input type = "text" name = "COPIES" id = "COPIES" onchange = "total ()" accesskey = "1" tabindex = "1" default size "0" = "10" = > "
    < input type = "text" name = "ORIG" id = "ORIG" onchange = "total ()" size = "10" accesskey = "2" tabindex = "2" default = "0" / > "
    < input type = "text" name = "mytotal" id = "mytotal" readonly = "true" size = "10" / >
    < input type = "submit" name = "submit" value = "Submit" / >

    I guess you want to get the "selected" option from the selection list?

    You call the js function in the onchange event of the select list just pass it as a parameter

    Select name = "paperlist" id = "paperlist" onchange = "total (this.selectedIndex.value)" > "

    total function (slectedValue)

    or

    document. FORMNAME. SELECTLISTNAME.options [document. FORMNAME. Alue SELECTLISTNAME.selectedIndex] .v

    This will give you the value selected from the list of selection, simply replace "FORMNAME" with the name of your form and your 'SELECTLIST' with the name of your selection list

    Ken

    Edit:
    Should have to read it again, yes you can do it.

    It is not clear which character you have between 2 values in the value attribute of the selection list, but I would suggest a comma, no spaces

    Then

    field5Array = field5.split(',');

    This will then give you the picture that you want with
    field5Array [0] equal to single sided
    and
    field5Array [1] equal to double-sided

  • I get BSOD with the key USB TV Tuner PX1211E-1TVD

    Hi all

    I just bought the model tuner TV USB Toshiba px1211e-1tvd and whenever I turn it on I get a blue screen error on my hp Pavilion dv6821el pc... dv6000 series.

    I tried to update the BIOS and the driver of my pc's display, but without results...

    The USB device is properly installed and the program (savvy tv) included with the cd as well, but I still get the Blue error screen...
    The operating system is Windows Vista...

    What can you suggest me to do folks?

    Please... I need help :-(

    Hello

    The BSOD appears usually due to a hardware problem problem or software commutabilite.
    I think in your case it s a software problem and I recommend updating the driver.

    The new driver could be found on the European driver Toshiba page in the Options area.
    On the driver page choose this:

    * Options-> Office Accessories based-> tuner TV USB hybrid TV Tuner Windows Vista 32 bit *.

    There you can find Savvy TV driver.

  • static reference with the global variable

    Hi, I used a static reference to a Subvi where I change a global variable before (3-4 years ago) and do not remember how I did it.

    It was something like these attachments, but now I'm using LabView 2013 instead of LV 8.6.

    The change in the overall operating system sees only not in the main vi (looks like the invoke node run vi does not work with globals).

    In addition the vi close with the invoke node close vi but not if I put the custom in the Subvi properties to automatically close.

    dkfire wrote:

    Why not call the sub vi as usual, just with the setting to display the front panel, when it is called?

    Use the connector pane to transfer the value of the sub vi Ok button when done.

    That's what I recommend.  If this is not possible for some reason, then you will need to use a flat Structure of the sequence to force the reading of the global variable after the Subvi is complete.

  • HTTP GET method with the body of the message

    Hi all

    I work with an API using HTTP to make calls to a server. I met an API call in the documetnation that uses the HTTP GET method with a message body. It seems that this is not supported by LV14 because I do not see an entry of message body for the LabVIEWHTTPClient.lvlib:GET.vi function. The POST methods and COULD appear to be banned for this API call, I a not found 405. I could be stuck with the help of GET.

    Certainly, this isn't recommended GET method - but it is not explicitly forbidden in the HTTP/1.1 specification. Is there a work around to submit an HTTP GET request to content? I have to use HTTP external DLL to achieve?

    All entries would be great.

    Thank you

    Richard

    Seems to be a problem on the server side?  Maybe I misunderstood what you were trying to get?

  • Get lost with the controls on the panels

    Hi all,

    With the help of Lavwindows 2010

    I have a little difficulty with my UIR.  I inherited a project with several panels, 2 have about 340 controls on each of them, I'm looking at (for example) a certain (RATE) control properties. I use the tree Panel to get the table I want and the FREQUENCY control.  I double click on the name of the control RATE.  In the details (under the tree Panel) section, it shows the name of the constant is MLED_MAX12_2 and its status led (its really a digital slide).

    Is it just that CVI has trouble with panels containing a large amount of controls?

    Is there another way for me to access this control? (right click on RATE and by selecting OBJECT UI FIND gives me the properties of the control MLED_MAX12_2.

    Is there a limit to the number of controls on a Panel? of the project? File of the UIR?

    Thank you

    Pete Hedlund

    I couldn't reproduce it in 2010 SP1, so I tried in 2010, and I could reproduce the bug. This problem has been fixed in 2010 SP1.

    http://zone.NI.com/DevZone/CDA/tut/p/ID/12323#290057_by_Category

    The solution is to change the control in the edit control dialog box that appears when you click on , when a control has focus in the editor the user interface with the editing tool selected (as opposed to the tool of exploitation). Or you can double-click the control to display the edit control dialog box.

Maybe you are looking for

  • Satellite A500 - plugged, but not charging

    Hey guys, I hope someone can help me with this. I bought a Satellite A500 about a year ago. Last night I decided it was time for an upgrade, so I looked at the new a500s. Put my current for sale online. Woke up this morning with a little problem. Whe

  • l don't want calls FaceTime anyone! What l do to completely turn off the FaceTime?

    I just got the iPhone 6s more & l do not want calls FaceTime anyone! What l do to completely turn off the FaceTime? I read about some callers blocking, but I want to block all access to me via Facetime. Thanks for any help you can provide! E

  • Animation work is not for card games

    After installation of Service Pack 2 of unsucessfully for Spider Solitaire, solitaire and hearts animation does not work. You have to keep clicking on the maps to see and they disappear until clicking on them again.

  • the program cannot start because the file d3d9.dll is missing on your computer.

    I get this error message whenever I restart my computer and he keeps me to access some Windows programs.  I know this is a device driver, but I can't understand that one.  Any help would be appreciated!  Thank you!

  • The browser choice

    Hello Choice of browser recently appeared on my computer and I don't want this program, I'm fine with Internet Explorer. How can I remove this? Thank you.