JavaScript help

Hello

I need help with javascript.   I have a dynamic action similar to below, but instead of testing a string of 1 byte, I want to test a substring.   So, if C1 = "111111', and I want to test check the first character (IE."  '1'), how I would clarify that?

Thank you.

Paul

$("td[headers='C1']").each(function(){
   switch($(this).text())
   {
        case "1":
           $(this).parent().children("td[headers='FC_QTY_MONTH01']").css({"background-color":"#FFFF99"});
           break;
        default:
           break;
    }
    $(this).css({"visibility":"hidden"});
    $("th[id='C1']").css({"visibility":"hidden"});
});

Hello

Try using the substr JavaScript method.

http://www.w3schools.com/jsref/jsref_substr.asp

Try if it works

$("td[headers='C1']").each(function(){
   switch($(this).text().substr(1,1))
   {
        case "1":
           $(this).parent().children("td[headers='FC_QTY_MONTH01']").css({"background-color":"#FFFF99"});
           break;
        default:
           break;
    }
    $(this).css({"visibility":"hidden"});
    $("th[id='C1']").css({"visibility":"hidden"});
});

Kind regards

Jari

Tags: Database

Similar Questions

  • JavaScript help: get the current line inside tabular

    Hello world

    I hit a roadblock for a simple JS code: to get a current line for my tabular form. My environment is: Apex 4.2.6 on Oracle 11.2 with 3 Bootstrap for styling.

    The query in tabular form is as simple as this:

    Select

    "REF #"

    «INV #»

    "MANUFACTURER."

    "DISCOUNT."

    'PRICE ',.

    "UPC",

    "DESCRIPTION."

    quantity,

    "LINE NO.",.

    "" step by step

    of Order_items

    Now the emphasis here is "stepper", it is defined as "text save any State", in the expression of the HTML, I added this:

    < div class = "btn-group" >

    < button type = "button" class = "btn, btn - lg" onclick = "plusClicked ()" > + < / button >

    < button type = "button" class = "btn, btn - lg" onclick = "minusClicked (); ">-< / button >

    < / div > <!-/-> button

    The screen is as follows:

    Screen Shot 2015-02-06 at 9.44.49 AM.png

    In the header of the Page Javascript section:

    function plusClicked() {}

    var line, qty;

    Row = $(this). Closest ("TR");

    I tried row = $(this) .parent () .closest ("tr");

    same undefined result

    Qty = Row.Find ('input [Name = F09]'). Val();  F09 is the entry for the qty column name

    Alert ('most clicked qty =' + Qty);

    }

    The result is always: 'most clicked qty = undefined ".  Inspect the code says this:

    Screen Shot 2015-02-06 at 9.57.49 AM.png

    Any help and suggestions are greatly appreciated.

    The few I tested it seems solid to me.  I think you have to pass 'this' to plusClicked and minusClicked.

    onclick = "plusClicked (this)" "

    Then, the function can do:

    function plusClicked (btn) {}

    var line, qty;

    Row = $(BTN). Closest ("TR");

    Qty = Row.Find ('input [Name = F09]'). Val();  F09 is the entry for the qty column name

    Alert ('most clicked qty =' + Qty);

    }

    The other approach, I like it for it's with a DA.  I would like to add a class to the buttons instead of the onclick.

    DA would be during the click on jQuery selector .btnPlus

    and the JS to run would be:

    var $row = $(this.triggeringElement) .closest ("tr");

    var qty = $row.find('input[name=f09]').val ();

    Alert ('most clicked qty =' + Qty);

    I hope this helps.

    Thank you

    -Jorge

  • PDF forms JavaScript help

    Hello

    I learned the hard way JavaScript forms may not work on tablets (through various OS). I have two scripts for calculating custom running in my form and I was wondering if there is another way to write, or a work around, where he will work on tablets (I'm no JavaScript expert!)?

    I have a calculation that counts the number of boxes in a list (check the 20-31) that are enabled:

    var total = 0;

    for (var i = 20; i < = 31; i ++) {}

    If (this.getField("Check_Box"+i).value! = 'Off') total ++;

    }

    Total = Event.Value;

    From there, I have another calculation that returns a value in another field, based on the number of boxes checked:

    var a = this.getField("Check_Box_Count").valueAsString;

    Event.Value = "";

    If (a == '1') event.value = "0.00";

    If (a == '2') event.value = "300.00;

    If (a == '3') event.value = "300.00;

    If (a == "4") event.value = "300.00;

    If (a == '5') event.value = "300.00;

    If (a == "6") event.value = "300.00;

    If (a == '7') event.value = "300.00;

    If (a == '8') event.value = "300.00;

    If (a == '9') event.value = "300.00;

    If (a == '10') event.value = "300.00;

    If (a == "11") event.value = "300.00;

    If (a == '12') event.value = "300.00;

    I don't know which one, or both, is the question. Is there a work-around, I could use?

    Thank you very much in advance for any help!

    ValueAsString property is not supported in Adobe Reader for iOS/Android. It is not clear to me if you could get away with using the property value instead, but of what you show this should work if you change the code to:

    If (a == 1) event.value = "0.00";

    etc.

  • Custom JavaScript help

    I have 5 combo with choice boxes of Y, N and NA. When enabled will score 3, when selected the partition is 0, when is selected the score indicates no score. I have a text box which then displays the final score in 5 drop-down list boxes, on a possible 15. I have a last text field that will show a pass or careless. A pass would be 15 nothing less that 15 is a failure. I have JavaScript custom indicating the following:

    Invoke the var = new Array ("6 Combo Box 1", "6 Combo Box 2", "6 Combo Box 3", "6 Combo Box 4", "6-5 combo box");

    var aDefault = new Array();

    for (var i = 0; i < aFields.length; i ++) {}

    If (this.getField(aFields[i]).value == this.getField(aFields[i]).defaultValue) {//compares value in the default value field is empty

    aDefault.push (aFields [i]);  This will create an array of fields not filled

    }

    }

    var = v + this.getField ('Model Call Score') .value;

    If (v > 14) event.value = "Pass";

    else event.value = "Fail";

    Check if aDefault contains at least one field

    If (aDefault.length > 0) {}

    Event.Target.Display = display.hidden;

    hide my value if a field is always empty

    }

    else {}

    Event.Target.Display = display.visible;

    }

    I understand that the last part of the code says to make the hidden value. I want a success or a failure is displayed only when all combo boxes are selected. I don't have knowledge of JavaScript. Could someone please help me fix my current or future code with another suggestion. A link to my form is attached. My question above refers to the lower part.

    Change this line:

    If (this.getField(aFields[i]).value == this.getField(aFields[i]).defaultValue) {//compares value in the default value field is empty

    To do this:

    If (this.getField(aFields[i]).value = this.getField(aFields[i]).defaultValue) {//compares value in the default value field is empty

  • JavaScript help please

    I want to be able to have a drop-down list box to automatically populate a field with a sentence or a number. I don't know javascript and need help.

    For example, in the "drop-down list box 1" - cats, dogs, Hamsters, fish

    If I chose to cats, the field 'Text1' must '25 000 '.

    If I chose the dog, the field 'Text1' must '10 000 '.

    I know that it is a simple custom calculation but still need help

    Thank you

    The easiest way is to set the value of the export of each element of list box the corresponding numerical value. The calculation simply sets the value of the field to the value of the drop-down list box. In JavaScript, this would be:

    Event.Value = getField("combo_box_1").value;

    If you do not want to set export values FRO the drop-down list box, the custom calculation script might look like:

    (function () {}

    Object to associate items drop-down list with numbers

    oval var = {}

    "Cats": "25 000",

    'Dogs': '10 000 ',.

    'The birds': '15 000 '.

    }

    Set this field to the associated to point number value, or empty if missing

    Event.Value = oval [getField("combo_box_1").value] | "";

    })();

  • JavaScript: Help with IF statement

    I'm not familiar with Java and I fight with this IF statement and I can't make it work.  I'm sure it's something pretty basic.  Can anyone help?  I tried everything, seeminly.  In this example below I'm checking if the data that the user has entered in the field of the AAA FAVOR and if it is then put in place a message and if not then set up another message.  My top node in my hierarchy is data, and then I have a MainSubform and a Contact02Subform.  I have this code attached to a button and notthing happens when I click the button.  If I delete the statement and have just the box of message by itself, then it will display the message box.  So I know that's my statement and I'm sure it's simple.  Help please?

    If

    (xfa.resolveNode("xfa.form.data.MainSubform.Contact02Subform.FAVOR").rawValue == 'AAA')

    {

    xfa.host.messageBox ("my IF");

    else ;

    xfa.host.messageBox ("my ELSE");

    endif;

    Try this.

    If (rawValue. xfa.resolveNode("xfa.form.data.MainSubform.Contact02Subform.FAVOR") is 'AAA')

    {

    xfa.host.messageBox ("my IF");

    }

    on the other

    {

    xfa.host.messageBox ("my ELSE");

    }

    endif is used in FormCalc are generally not in JavaScript.

    Thank you

    Sidonie.

  • Sum of JavaScript help

    Hi people,

    I have a LiveCycle application form that calculates a total purchase amount. If this total is equal to or greater than $1 000,00 subform 'comparativeBids' must be made visible. The calculation works very well in FormCalc but not in JavaScript. Can someone help me understand how to calculate JavaScript to function? I'm not familiar with FormCalc enough to write conditional statements using this language but I am ready for, it is somebody can provide the script.

    Anyway, here's my JavaScript for grandTotal (calculate event):

    PRForm.generalInfo.totalGroup.totalTable.grandTotalRow.grandTotal::calculate - (JavaScript, client)

    this.rawValue = subtotalRow.subtotal + taxRow.tax + shippingRow.shipping;

    comparativeBids.presence = 'hidden ';

    var order = xfa.resolveNode("PRForm.generalInfo.totalGroup.totalTable.grandTotalRow.grandTotal").rawV Alou;

    If (order > = 1000) {}

    comparativeBids.presence = "visible";

    }

    Note: I also tried the calculation as this.rawValue = subtotalRow.subtotal.rawValue + taxRow.tax.rawValue + shippingRow.shipping.rawValue; - again without success with the JavaScript version.

    Thanks in advance for the help!

    Well in formcalc if statement would be:

    If ($ > = 1000) then

    comparativeBids.presence = "visible".

    on the other
    comparativeBids.presence = "hidden".

    endif

  • Flash, HTML javascript help!

    Hi all

    I have 50 different images on my server, the images are loaded into the flash. and also, I created an HTML page that I will use to show the images. Now in flash when the user clicks on a particular image, this image should be loaded into the HTML code we already have on the server.

    So I need to pass the name of flash to HTML to find the clicked image is displayed. I also want to hide the tool, the State... on the HTML toolbar.

    If it is possible to load the HTML on full screen, that will be great.

    Here, I did something...

    btnClipMc.addEventListener (MouseEvent.CLICK, onBtnClicked);

    var address: String = ("two.html");

    var URL_var:URLVariables = new URLVariables();

    function onBtnClicked(evt:MouseEvent):void

    {

    URL_var. Query = inpTxt.text;

    var jscommand:String = "window.open (" "+ address +" win ',' ',' toolbar = no, scrollbars = no, location = no, status = no, menubar = no. ' ");"

    urlReq:URLRequest = new URLRequest ("javascript:" + jscommand + "void (0);");

    urlReq.data = URL_var;

    navigateToURL (urlReq, "_self");

    }

    This displays an error message.

    Can you help me fix this script?

    I did...!

    variable that you want to switch to HTML

    imageName = "image_1".

    do the restrictions of html with query

    var address: String = "" largeView.html? query = "" + imageName;

    var jscommand:String = "window.open (" + address + "win ',' ',' width = 1100, height is 600, resizable = yes, toolbar = no, scrollbars = yes, location = no, status = no, menubar = no, left = 0, right = 0');";

    JS final to trigger the HTML code

    var jscommand:String = "window.open (" + address + "',' victory ',' width =" + finalWidth + ", height =" + finalHeight + ", toolbar = no, scrollbars = yes, location = no, status = no, menubar = no, left = 0, top = 0');";

    request URL

    var urlReq:URLRequest = new URLRequest ("javascript:" + jscommand + "void (0);");

    The HTML JS call

    navigateToURL (urlReq, "_self");

  • If/then JavaScript help needed

    Hello

    I'm trying to write a script for a PDF in Adobe Acrobat form, but I don't have much experience with JavaScript and I need help!

    Basically, I have five fields as follows:

    A1 = a checkbox

    B1 = a field with a numeric value in it

    C1 = one field with a numeric value in it

    D1 = a field with a numeric value in it

    E1 = a field where calculation of the sum.

    I want to write a script that will enter into the sum of the values of B1 + C1 + D1 E1 if a1 is checked yes.

    If it is not checked yes, then he enters the sum of the values of B1 + C1 + D1 value by 2 (and rounded down) divided in E1.

    Can anyone help?

    Thank you!

    This should do it like the custom for E1 calculation script:

    // Custom calculate script
    (function () {
    
        // Get the field values, number fields as numbers
        var a1 = getField("A1").value;
        var b1 = +getField("B1").value;
        var c1 = +getField("C1").value;
        var d1 = +getField("D1").value;
    
        // Set this field (E1) value based on the state of the check box
        if (a1 === "Off") {
            event.value = b1 + c1 + d1;
        } else {
            event.value = b1 + c1 + Math.floor(d1 / 2);
        }
    
    })();
    
  • JavaScript - help the layers?

    I'm in DW CS3 I have a page which is essentially a background image in a container of css. All I have to do is put images flown in some places. I used diapers for the ANS of buttons animated when previewing in Firefox, the images line up, in Safari, the images are disabled. If I try to compensate for each browser bearings includes texts in the peak of bg. I don't check don't even how it looks in IE7 yet, but I know that there is javascript that can be put in the header of the page to make the elements to bring the best in can someone help me out here?

    rdmtl

    Ah I see, thanks for this tidbit that I never use hot spots so far

  • Need a bit of JavaScript help with deactivation of a selection list in a table frm

    Hello people

    Here's the scenario.

    I have a tabular presentation which, subject to the setting from the list, select I want to toggle each other.

    I've had to date and it allows to disable a text element, but not a list of selection...

    It is in the HTML of the page header section...

    < script type = "text/javascript" >
    function test (pThis)
    {
    var currIndex = $('select[name="'+pThis.name+'"]').index (pThis);

    If (pThis.value == '2') {}
    . style.backgroundColor $('input[name="f02"]') [currIndex] = "LightGrey";
    $('input[name="f02"]') [currIndex] .disabled = true;
    }
    }

    The report is defined as...

    SELECT iot_rebate_type_id apex_item.text (1, ir.iot_rebate_type_id)
    apex_item.select_list_from_lov_xl(2,ir.rebate_currency,'LOV_CURRENCY_CODES') rebate_currency
    To iot_rebate ir
    WHERE ir.iot_agreement_id =: P303_IOT_AGREEMENT_ID

    The iot_rebate_type_id column is an attribute of the column element value...

    OnChange = "JavaScript:test (this); »


    As I say, if I set the currency of repayment as a text element, the JavaScript works fine.

    Can anyone offer any suggestions?

    Thank you very much

    Simon
    Request Express 4.0.2.00.07

    Sounds familiar to me...

    to manage selection lists change the function javascript like this

       function test(pThis)
       {
        var currIndex = $('select[name="'+pThis.name+'"]').index(pThis);
    
         if (pThis.value=='2') {
         $('select[name="f02"]')[currIndex].style.backgroundColor = "LightGrey";
         $('select[name="f02"]')[currIndex].disabled=true;
         }
     }
    
  • JavaScript help acrobat

    Hello

    I'm new here

    I hope you can help me with my wish

    So I have 2 fields, one is second TEXT1 is Text2. I want to do the following:

    If the value of Text1 "75000" then I want to change value automatically TEXT2 '150 '.

    Thank you

    Best regards

    Use what the calculation script personalized to TEXT2:

    var v = this.getField("TEXT1").valueAsString;

    If (v == "75000") event.value = '150 ';

    else event.value = "";

  • CFLOOP &amp; amp; JavaScript help

    I wonder if I can make this script work. I am wanting to 'i' to be available for javascript is there a way to do this? Anyone have any ideas? Thank you
    < CFLOOP to = "#abilityQ.recordcount # '1' = ' index 'i' = >"
    #abilityQ.question < CFOUTPUT > # < cfform >
    < cfinput type = "radio" name = "A1" label = "Yes" value = "Yes" >
    < span class = "questionsNormalAnswer" > Yes </span > k
    < cfinput type = "radio" name = "A2" label = "" onClick = "javascript:MM_showHideLayers('incorrecti','','show');" value = "No" >
    < span class = "questionsNormalAnswer" > </span > n
    < / cfform > < hr align = "center" width = "75%" class = 'horizontalline' > < / CFOUTPUT >
    < / CFLOOP >

    Hello

    Your onClick attribute must be like this,

    onClick = "javascript:MM_showHideLayers('incorrect#i#','','show')";

  • 'Save as master' in JavaScript - Help!

    Hello guys,.

    I have an inDesign file with 3 pages. I want to create 3 new 'Master spreads' as (B-Master, C-Master, D-Master) with the same content in these 3 pages, such as 'Save as' function inDeisgn UI. Is there a way that this can be done with the script?

    I'm not trying to apply one master spread to the new master page spread, or master spread to a new page, but creates a new master by using the existing page.

    Suspicion, a direction, immensely appreciated.

    Who had a lateral thinking - and three accidents of InDesign!

    The canonical method to use is "double", but apparently you can not simply "duplicate" a page on the end of your current master spreads (which caused my ID crashing, silently). With this workaround, it works:

    1. Add a new master spread and force it to be just 1 page, because it seems that the default is a spread together.

    2. on your page at the end of its 'Pages' of the tag property.

    3. remove the single page at the beginning of your master page, since you do not need more.

    It works for me in CS4:

    p = app.activeWindow.activePage;
    m = app.activeDocument.masterSpreads.add(1);
    p.duplicate (LocationOptions.AT_END,m.pages[0]);
    m.pages[0].remove();
    
  • Use about Central button mouse to call the JavaScript function question

    I want to use the mouse middle button to call the function JavaScript (< a href = "javascript:help ()" >) help() opens a new window and directly to the Help Page of my GUI, but when I click on it with the middle button, it will open new tab blank Page that url = "javascript:help()"; " can't help executive function... What is a Firefox Bug or a correct behavior in Firefox? I thank.

    You must use left click to manage JavaScript links.

    See also http://kb.mozillazine.org/browser.link.open_newwindow.restriction

Maybe you are looking for

  • Apple Care warranty on my unlocked 6s

    OK... If a friend gives me their 6s. It has been 4 months and there Apple Care (for a year, I'm pretty sure). His career is Sprint but I live in the Canada and I wanted to use it here. Then it will unlock it and send it here. Now something is happeni

  • I need Windows XP for Satellite 2450-201

    Can anyone help me?. Where can I get a copy of Windows XP to a Satellite 2450-201? Thank you. Felix

  • Upgrade SSD in a laptop 15.6-inch HP laptop laptop 15-ay011nr

    HelloI want to buy the laptop next: HP 15-ay011nr laptop So, I want to put the ssd build-in to a Samsung evo 850 500 GB ssd (2.5 inches).I can not find on the internet what slot is used for the build-in one. I saw something on the M2, but not sureCan

  • No sound from speakers comes no audio device installed

    After the reboot is complete, I have no sound no audio device not installed due to how to find and install

  • DeskJet F 2480 ink level

    Is it possible to check the level by software F2480 ink cartridges? I can't do it. Could you please help me? Labour doesen ' a black t and I would check before replacing. Thank you.