Java Script in a header on a html page in an apex application

I have the following function in the html of a page header in an apex application
function calc(pThis){
     if(checkItem (pThis)){
          var lName = pThis.id.split('_');
          var lName2 = [];
          var gCalcRow = 0;
          var gCalcCol = 0;
          var gCalcTotal = 0;
          var lTable = $x_UpTill(pThis,"TABLE");
          var gInputs = html_Return_Form_Items(lTable,'TEXT');

          var gRow = pThis.parentNode.parentNode;
          gRow = gRow.cells[gRow.cells.length-1];

          var gCol = pThis.parentNode.cellIndex;
          gCol = lTable.rows[lTable.rows.length-1].cells[gCol];

          var gTotal = lTable.rows[lTable.rows.length-1].cells[gRow.cellIndex];

          for (var i=0; i<gInputs.length ;i++){
               lName2 = gInputs.id.split('_');
               if(lName2[1] == lName[1]){
if(gInputs[i].value-0 != ""){
                    /* calc row */
                    gCalcRow = gCalcRow + (gInputs[i].value-0);
               }}
               if(lName2[0] == lName[0]){
if(gInputs[i].value-0 != ""){
                    /* calc column */
                    gCalcCol = gCalcCol + (gInputs[i].value-0);
               }}
               /* calc total */
if(gInputs[i].value-0 != ""){
               gCalcTotal = gCalcTotal + (gInputs[i].value-0);
          }}
               return;
}
I only wish to calculate totals if the values in the gInputs fields are not null I have added the if(gInputs.value-0 != "") statement however when the code executes is raises a NaN error, I have no real experience using java script so my syntax could be way off.

Any help would be great

Tina

Edited by: tinaK12959565 on 09-Sep-2010 04:14

Hello

NaN is the return of JS for not a numbercode.

The user this feature to test the digital

function isNumber(n) {
  return !isNaN(parseFloat(n)) && isFinite(n);
  // Return TRUE if n is number , else returns false
}

Add the function above in your header HTML script

Change your code to use this feature

 //if(gInputs.value-0 != ""){if (isNumber(gInputs[i].value) ){/* calc column */

Regards,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

Tags: Database

Similar Questions

  • java script two function in the Form HTML element attributes

    Hello

    How can I call two java script function (onBlur = "javascript:sumItems()"and onkeyup = "CopyFromTo (this, 'P600_AMOUNT_PAID')"); on HTML attributes of elements shaped the source in a single element.



    Thank you
    Maury

    Published by: Ed on September 25, 2009 22:47

    In "Header HTML" of your page.

    Saad,

  • If I put a script in the header of a master page will work on all pages related to this basic form?

    If I put my google analytics script in the header of the master is it works on all the pages related to this basic form or should I put the code in the header of each individual pages?

    The master added to the page code will be added to all pages based on that master and perform accordingly.

    Thank you

    Vikas

  • Building simple HTML Page at the APEX

    Hello
    I am very new in APEX and this is the first project of mine to try to convince my organization as a good tool to use. I'm mainly a developer of forms. So, I'll build a Workbench for the Group profits in my company and my first page must be just a homepage with static text and a couple of links to launch my next pages. I added a blank home page at my request and then to EDIT the properties of the region on this same page, I type my static text and it is coming in the text mode free movement, I want to change the fonts, the sizes of some texts and give new lines etc..
    My question is that I have to write HTML code to achieve this in the part of the source text?

    Thank you
    Vishal

    Vishal,

    Yes, if you create an area HTML, you will have to manually put your HTML in there. APEX does not give you a WYSIWYG editor (as I know), but it should be easy for them to do - one of the options for creating an input field is a rich TEXT Editor. I don't know why they didn't implement which.

    My personal recommendation for HTML static is to change in your current Favorites out of the editor and then copy - paste the HTML code in the APEX.

    -David

  • PHP Header Error on HTML Page

    I'm putting some php I made in a html file, but I'm running into a problem. My PHP script is a login name in the script and when I got the connection I get the following error:

    Warning : Cannot modify header information - headers already sent by (output started at home/tyharox1/public_html/login.php:64) in /Home/tyharox1/public_html/login.php online 83

    Here is the code for the html with already written in php file. Can someone help me solve this problem?

    <? PHP

    session_start();

    include ("fopen");

    ? >

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    < head >

    <!-[if lt IE 9] >

    < script src = "html5shiv.js" > < / script >

    <! [endif]-->

    < link href =' http://fonts.googleapis.com/CSS?family=CODA ' rel = "stylesheet" type = "text/css" >

    < link rel = "stylesheet" type = "text/css" href = "mainmenu.css" / >

    < link rel = "stylesheet" type = "text/css" href = "submenu.css" / >

    < link rel = "stylesheet" type = "text/css" href = "mainpage.css" / >

    < link rel = "stylesheet" type = "text/css" href = "slideshow.css" / >

    < link rel = "stylesheet" type = "text/css" href = "ribons.css" / >

    "< script type =" text/javascript"src="js/jquery-1.2.6.js "> < / script >

    < script type = "text/javascript" src = "js/startstop - slider.js" > < / script >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"

    <!-TemplateBeginEditable name = "doctitle"-->

    Home < title > < /title >

    <! - TemplateEndEditable - >

    <!-TemplateBeginEditable name = "head"->

    <! - TemplateEndEditable - >

    < style type = "text/css" >

    {body

    background-color: #222;

    }

    < / style >

    < / head >

    < body >

    < div >

    "< img name ="Logo"src =" images/84087.jpg"width ="100% "height ="50px"alt =" "/ >

    < / div >

    < div id = "mainmenu" >

    < ul >

    < li = class 'active' > < a href = ' Templates/index.html' > < span > </span > < /a > < /li > AITP

    < li > < a href = "#" > < test span > < / span > < /a > < /li >

    < li > < a href = "#" > < test span > < / span > < /a > < /li >

    < li > < a href = "#" > < test span > < / span > < /a > < /li >

    < li > < a href = "#" > < test span > < / span > < /a > < /li >

    < /ul >

    < / div >

    < / div >

    < div id = "submenu" >

    < ul >

    < class li = "active" > < a href = ' Templates/index.html' > < span > </span > < /a > < /li > home

    < li > < a href = "#" > < span > </span > < /a > < /li > about us

    < li > < a href = "#" > < span > </span > < /a > < /li > calendar

    < li > < a href = "#" > < span > </span > < /a > < /li > Contact

    < li > < a href = "#" > < span > </span > < /a > < /li > members

    < /ul >

    < / div >

    < div >

    < / div >

    < div class = "Ribbon" >

    Login member < h3 > < / h3 >

    < article = 'fill' id >

    Please login

    <? PHP

    session_start();

    include ("fopen");

    If (isset ($_POST ['submit'])) {}

    $username = mysql_escape_string($_POST['username']);

    $password = mysql_escape_string (sha1($_POST['password']));

    If (! empty ($username) & &! empty ($password)) {}

    $sql = mysql_query ("SELECT * from users")

    WHERE username ='"." $username. "" AND "

    user_password ='"." $password. (""LIMIT 1");

    If (mysql_num_rows ($sql) > 0) {}

    $_SESSION ['loggedin'] = true;

    $_SESSION ['username'] = $username;

    header ("Refresh: 2;") URL = index.html");

    echo "< span style =" color: #063; make-weight: bold; ' > successful login! You will now be redirected, please wait... </span > ';

    } else {}

    echo ' your username and/or password is incorrect ".

    }

    } else {}

    echo 'You must enter a suername and password!';

    }

    } else {}

    "echo" < do action = "login.php" method = "post" >

    User name: < input type = "text" name = "user name" / > < br / >

    Password: < input type = "password" name = "password" / > < br / >

    < input type = "submit" name = "submit" value = "login" / >

    < / form > ';

    }

    ? >

    < id article = 'date' >

    < span id = "Publisher" > Publisher: </span > Jane Doe < span id = "Publisher" > Date: </span > 10 October 2012

    < / section >

    < / section >

    < / div >

    < / div >

    < div id = "footer" >

    < / div >

    < / body >

    < / html >

    You may not use the PHP header function after that whatever it is sent to the browser. Whatever it is. You can have 100 lines of PHP before the header() function as long as the script nothing sent to the browser.

    So your options are to revise your code accordingly or use a javascript alternative, as in this example, where a little embedded php sets the real url, but javascript is used to treat:

  • script addition on my flash in html page

    Page errors. This script can enter my page html with the im adding in flash. my page does not display in the internet after download. www.aurorabiomed.html/flashretreat.html. whenever I have add a flash file in my Web page, this script is added, and my page has errors. This was not the case until I reformatted my hard drive and reinstalled dw8

    ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
    "< html xmlns =" http://www.w3.org/1999/xhtml "> "
    < head >
    < meta http-equiv = "Content-Type" content = text/html"; charset = iso-8859-1 "/ >"
    < title > Untitled Document < /title >
    "" < script src = "... / Scripts/AC_RunActiveContent.js" type = "text/javascript" > < / script >
    < / head >

    < body >
    < script type = "text/javascript" >
    AC_FL_RunContent ('codebase',' http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7, 0.19, 0', ' wid th pluginspage ', '120',' height', '600',' src', ' assets/retreat07', ' quality ',' high ',"',' http: / / w ww.macromedia.com/go/getflashplayer','movie','assets/retreat07' ); end AC code
    < /script > < noscript > < object classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase ="" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7, 0,19,0 ' width = "120" height = "600" > "
    < param name = "movie" value = "assets/retreat07.swf" / > "
    < param name = "quality" value = "high" / >
    < embed src = "assets/retreat07.swf" quality = "high" pluginspage ="" http://www.macromedia.com/go/getflashplayer ' type = "application/x-shockwave-flash" width = "120" height = "600" > < / embed > "
    < / object > < / noscript >
    < / body >
    < / html >

    Ive moved the scripts around and made all the changes in the source path has even obtained the Web page in the scripts folder and revised the source path and I always get errors on the page, I will just disable the script for now coz I need the downloaded flash. Thanks Murray! Yes now its version 8.0.2

  • How can I link to pages in a selection tree / index level 2 with java script popup?

    I can do something unique popup level using the java script below (#1) and selections link to pages but to change a tree of selection index popup level 2 as below (#2), I can't seem to understand how to link to the pages. Any help much appreciated. Thank you

    1

    var itemIndex = app.popUpMenu("INTRODUCTION", "ALPHABET", "GRAMMAR", "NUMBERS", "DATES & TIME", "GETTING TO KNOW PEOPLE", "PHRASES FOR LEARNING", "DIRECTIONS & TRANSPORTATION", "DESCRIBING THE TRAIL", "DO'S & DON'TS", "EQUIPMENT", "FOOD", "INTRODUCING A VILLAGE", "CULTURE AND ETHNIC GROUPS", "HANDICRAFTS", "TEMPLES & MONKS", "AGRICULTURE", "ANIMAL HUSBANDRY", "SCHOOL & EDUCATION", "LEADING A TREK", "NATIONAL PROTECTED AREAS", "IDENTIFYING WILDLIFE", "PLANTS & FORESTS", "BOATS", "CAVES ", "HEALTH AND SAFETY"() "

    switch (itemIndex) {

    case 'INTRODUCTION' :

    this.pageNum = 1

    breaking

    case "ALPHABET" :

    this.pageNum = 2

    breaking

    case 'GRAMMAR' :

    this.pageNum = 5

    breaking

    case "NUMBERS" :

    this.pageNum = 30

    breaking

    case 'DATE & TIME' :

    this.pageNum = 35

    breaking

    case "GET to KNOW the PEOPLE" :

    this.pageNum = 42

    breaking

    case "PHRASES FOR LEARNING" :

    this.pageNum = 56

    breaking

    case 'DIRECTIONS & TRANSPORT' :

    this.pageNum = 59

    breaking

    case "DESCRIBING THE TRAIL" :

    this.pageNum = 63

    breaking

    case 'Things to do and not to do' :

    this.pageNum = 68

    breaking

    case "EQUIPMENT" :

    this.pageNum = 74

    breaking

    case 'FOOD' :

    this.pageNum = 83

    breaking

    case "INTRODUCE a VILLAGE" :

    this.pageNum = 96

    breaking

    case 'CULTURE AND ETHNIC GROUPS' :

    this.pageNum = 105

    breaking

    case "CRAFTS" :

    this.pageNum = 120

    breaking

    case "The TEMPLES and the MONKS" :

    this.pageNum = 126

    breaking

    case 'AGRICULTURE' :

    this.pageNum = 131

    breaking

    case "FARMING" :

    this.pageNum = 140

    breaking

    case "SCHOOL & EDUCATION" :

    this.pageNum = 145

    breaking

    case "LEADING a TREK" :

    this.pageNum = 151

    breaking

    case 'NATIONAL PROTECTED AREAS' :

    this.pageNum = 155

    breaking

    case "IDENTIFICATION of WILDLIFE" :

    this.pageNum = 161

    breaking

    case "PLANTS & FOREST" :

    this.pageNum = 169

    breaking

    case 'BOATS' :

    this.pageNum = 175

    breaking

    case "CELLARS" :

    this.pageNum = 178

    breaking

    case 'HEALTH AND SAFETY' :

    this.pageNum = 182

    breaking

    }

    2

    var aINTRODUCTION = ['INTRODUCTION', 'How to use this book', 'Format'];

    var aALPHABET is ["ALPHABET", 'Vowels', 'Sounds consonants'];.

    var itemIndex = app.popUpMenu (aINTRODUCTION aALPHABET);


    Thank you.


    It works exactly the same... itemIndex will bear the name of the selected

    order of the day.

  • How to create indesign using Java Script

    I am new to indesign and want to create indesign application using JavaScript.

    When I use AppleScript to create the Application Indesign I use this statement

    Tell application "Adobe InDesign CS5.5"

    myDocument to make document with the properties of the value

    tell the end

    Application InDesign create successfully.

    How to create the Application Indesign using JavaScript?

    or what is set equivalent to (tell application "Adobe InDesign CS5.5") in Java Script.

    There is a sample java script given on the forum or in the sdk. These departure example with app.

    When I debug these java script using ExtendScript ToolKit 3.6 it gives error on app (application not defined). I think that this app AI application object.

    How to create indesign application object app in javascript?

    Although this script runs successfully when I put these script in C:\Program Files\Adobe\Adobe InDesign CS5.5\Scripts

    and executing these script use the Scripts panel (choose window > utilities > Scripts), and then double-click the script name in the Scripts panel in indesign application. But in this case I have indesign application start and then choose window > utilities > Scripts, and then double-click the script name in the Scripts panel.

    I want to create Application Indesign (instance), using JavaScript.When I run or (debug) my JavaScript in any javaScript tool as ExtendScript ToolKit 3.6 then Indesign application should start, as in the Apple Script.

    Thank you

    long story short... NO!

    However, if you run the script from ESTK, you need not copy the script in the folder "Scripts". Do not know exactly if that's what you want.

  • EXC in ev handl: TypeError: this.oRoot.enable is not a function that is popping up when I befor I open my browser in a box pop up under the heading JAVA SCRIPT EXE. That is - what, how can I get rid of him?

    TypeError: this.oRoot.enable is not a function

    This is popping up when I befor I open my browser,in a pop up box under the heading JAVA SCRIPT EXE. What is it, how do I get rid of it?
    

    For me, this happened from disabling, but do not uninstall McAfee site Advisor. Recommend site completely uninstalled and the problem disappeared completely. I had turned off before site Advisor, but it seems after a update to McAfee, he was back and then turn it off again caused this problem.

    Go to "uninstall a program" or "add/remove programs" in control panel. Find McAfee in your list (McAfee total protection for me). Click it and then click "Uninstall/Change" (right there in XP, up above in Vista or 7). I don't remember exactly what you see after that, but at one screen I was given the choice to uninstall the McAfee total protection and/or the Site Adviser. You can just check the Site Adviser and just uninstall the Site Adviser while retaining the rest of the McAfee protection.
    

    Good luck!

  • my Java Script and html do not work correctly in any other browser other than Internet Explorer

    original title: my html and Java Script do not work correctly in another browser other than Internet Explorer, which is not the only browser used with Windows. How can I fix it?
     
    -
    -
    600
    4
    6
    0 x 80000000000000
    15
    Windows PowerShell
    WIN-GRBD073PMKI

    +
    Function
    Has begun
    ProviderName = Function NewProviderState = SequenceNumber started = 5 HostName = ConsoleHost HostVersion = 2.0 HostId = 9 a 968549-639 a-4de1-9012-5b443edaae11 EngineVersion = RunspaceId = PipelineId = CommandName = CommandType = ScriptName = CommandPath = command line =.

    Hello

    The question you posted would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums.

    http://social.msdn.Microsoft.com/forums/en-us/iewebdevelopment/threads

    I hope that helps!

  • Squarespace user. Want more options on my site. Adobe has tutorials on Java Script, HTML, and CSS? [was: new user Question!]

    Hello!

    I am a new user to adobe creative cloud. I'm a Web site manager for pge production broadcast in my school and I use squarespace but I want to upgrade and have more opportunities with my websites. Adobe has tutorials on Java Script, HTML, and CSS?

    Not in the way, I think you mean. There are a number of very generous gurus on this forum that will help hard problem solve you your code, and the best way to learn is always, spoil, figure it out and move on to the next thing. :-)

    Googling a question will generally help to guide you on the right track and you can always visit W3 Schools or Code Academy for free tutorials or check if there is a Free Code Camp in your area. Sources for tutorials or classes are Lynda.com, Noble of officeand the General Assembly.

    Chris

  • Is there a way to way to a mobile site redirection script in the header HTML in Muse? Is there a way to accsess the html header in Muse?

    Is there a way to way to a mobile site redirection script in the header HTML in Muse? Is there a way to accsess the html header in Muse?

    Best regards

    Thor Ivar

    Hello

    If you are ready to insert a script in the header of the Page header, follow these steps:

    1. in Design view, open the page or master page.

    2. go to Page > Page Properties > metadata > paste the script in "HTML for."section.

    Apart from using mobile site redirect script, you can take also relating to the possibility of creating a mobile layout in muse. Please see the links in the thread below:

    Hi, can someone help me, I did my first page in Muse, and I did just for computer, do I Tablet and phone, I have to do?  THX

    Regards

    Vivek

  • How to enable the Java Script function in APEX 4.2.6 running on the result of an Xquery query.

    How to take a SQL query result in the source section of an APEX "agenda of the page" field and allow this request to be formatted using XML in an HTML format for a Java Script file to perform a function on the result?

    Currently I have the following text:

    To query the DB table and format the result as HTML:

    SELECT XMLELEMENT ("UL id ="ticker01"', XMLAGG (XMLFOREST (Scroll_Mess AS LI))") "item UL' OF Web_Ticker where Mess_Id < 10 order by Mess_Id;


    That displays the following:


    < UL id = "ticker01" > < LI > HELLO < /LI > < LI > HELLO < /LI > < /UL id = "ticker01" >

    I need the output of this to be visible to a JScript function that is currently called the "head of page", but there doesn't seem to be its scope? The function works correctly if there is a list in the page field items 'Text element Pre' but does not work correctly when used in conjunction with the query to generate a table form.

    If everyone is happy to help I would be grateful .

    James.

    Solved!

    In order for the request to be part of the DOM of the page of the APEX, the Java Script allows to perform its function on the result marked "HTML" to query, you must set page of the apex on which the query resides and then add the inner text of this page to a second variable for which the function of web ticker can run on as follows:

    $(function() {})

    var x = $("#P9_TICKER_DATA");

    var y = x [0] .innerText;

    x.Append (y);

    $("UL#ticker01").liScroll ();

    });

    From there, on the Java script is able to properly see the result of the query in HTML format.

  • View only, and Java Script

    Hi guys,.

    I would try to explain my problem.

    I have two Select lists P58_TYPE_DOC (it displays for users with no SMA profile) and P58_TYPE_DOC_ADM (it shows just for the administrator).

    On my Page of propriety I header HTML copy the following code:

    OnLoad = "show_fk_facture ('P58_TYPE_DOC'); show_fk_facture ('P58_TYPE_DOC_ADM'); »

    I need to run java script when the page is loaded, but I can't run the function for both items at the same time.

    Because one of the items will be hidden, and java script won't be able to find it.

    I tried to use if "isNAN ('P58_TYPE_DOC') else... "but it does not work.

    You have any suggestions?

    Thank you
    Eric

    Eric Sacramento wrote:

    I created a SELECT according to the user's profile! Now it is worlking :D

    This doesn't seem to have anything to do with the original question, buit if you are certain that the problem be solved brand then please this thread as a response.

  • What snap is "Java Script"?

    Suddenly this morning I receive a message that Java Script is not enabled. I am not able to access Yahoo! mail, Gmail or iCloud mail. When I search for "Java Script" I get 300 + add-ins, the top 50, or appear not to be simply Java Script. What is the exact name of a supplement Java Script that will allow me to use my e-mail programs?

    JavaScript is not an add-in, but a language like basic, C, java and so on. It is often used on web pages to create dynamic effects like the movement of the figures and similar effects. Therefore, it is included in the HTML itself. For various reasons you might want to disable the ability to run java scripts, for example for security reasons and in older versions of Firefox, there is an option in the settings were you could turn on or off the ability to run these scripts. Nowadays, this option is removed, but is included in those more hidden that reach you by writing about: config in the address bar. If you do, you will get a warning "This might void your warranty!" and after clicking on the I'll be careful, I promise!-button you will enter the words: config page. Research of javascript.enabled, which is normally set to true. Double-click this line after selection, press enter on the keyboard and the value is going to switch from the other value, false.
    However, you may have loaded an add-on that blocks java script. I can imagine there are a lot of them. One that I use is NoScript, which allows me to choose individually what web sites I will allow running scripts in java on my computer, and who I would not deny this. Take a look of the modules you have loaded, so maybe one of them can block the ability of java script.

Maybe you are looking for