How to use javascript or formcalc to reference the child controls (no name)

Hello world

I've created a ton of reports in the past, and I am now looking to create some reusable objects so that other people can use features of advanced form without having to learn to use scripts.

A lot of the coding was done using this, .parent, etc. so that they can rename controls and subforms without having to worry about breaking the scripts. A question that I have is that some of my code looks at the child controls and refers to their name (for example, I have a code that uses setfocus to move the user to the first field of a subform).

In most languages, there are ways to refer to child controls through an indexer or an array of elements or children. i.e. Subform.items [0] .rawValue.

I know that this would cause some problems, but I think I could sort it out, if I only knew where to start. Is it possible to reference a child control without a name?

Thanks for your help!

-Scott

Hi Scott,.

The subform has a collection of nodes, you can run a loop though, as you suspected him.  If could show more than you want, but you can test the className to see if it is a field, then ui.oneOfChild.className to the type of the field. Then;

for (var i = 0; i)< subform1.nodes.length;="">

{

var n = Subform1.nodes.item (i);

Console.println (n.className + "" + n.name + "" + n.ui.oneOfChild.className);

}

I hope this helps.

Bruce

Tags: Adobe LiveCycle

Similar Questions

  • How to use JavaScript to change the named view

    How to use JavaScript to change the named view

    Do you mean to jump to a specific Destination named within a PDF file? SE so there

    the method gotoNamedDest of the Document object.

  • How to use JavaScript to limit the number of boxes to check the user can select a PDF form?

    How to use JavaScript to limit the number of boxes to check the user can select a PDF form?

    Here's the working solution

    Please rename all the boxes like chkBox0, chkBox1... .chkBox30 (must start with 0)

    Value of exports of each checkbox must be "Yes" (default value is Yes)

    Place this Code at the level of the Javascript Document

    -Code JavaScript document-

    var counter = 0;                Checked the meter

    -Count boxes checked again when the document is closed and reopened.

    for (var i = 0; i)<= 30;="">

    If (getField("chkBox"_+_i).value == 'Yes') {}

    Counter += 1;

    }

    }

    -The function of validation-

    function validateCheckBox(name,value) {}

    If (value == 'Yes' & meter)<>

    Counter += 1;

    } else if (value == 'Off') {}

    counter = 1;

    } else {}

    getField ("name") .value = "Off";

    App.Alert ("you can select only four checkboxes");

    }

    }

    -End of Document Javascript-

    Now put this line in the MouseUp event all checkboxes

    Box - Code MouseUp event.

    validateCheckBox (event.target.name, event.target.value);

    //----------------------------------------------------------------------------------

    Hope this will help

    Kind regards

    Post edited by: Mohammad Irfan

  • How to use javascript to go to different pages?

    I use javascript to pop-up a message box with selection or not.

    If the user select Yes, and then I want to go to page 10.
    If the user select No, and then I want to go to page 12.

    How to use Javascript to control which pages to go?

    Thank you.

    Now, I need to get the values of entries in the list.

    What are the values that you need to get your entries in the list?

    Can you post JS and what you're trying to do?

    Kind regards
    Hari

  • You can use Javascript or HTML5 automatically detect the location of the viewers? Degree of accuracy can be?

    You can use Javascript or HTML5 automatically detect the location of the viewers? And if so, how specific can you be. . that is, down to the CITY, they are in? Or even the suburbs?

    You can use Javascript or HTML5 automatically detect the location of the viewers?

    Yes - it's called the geolocation API (http://www.w3.org/TR/geolocation-API/)

    A few simple examples:

    http://www.w3schools.com/HTML/html5_geolocation.asp

    And if so, how specific can you be

    In General, it is pretty accurate on GPS devices (mobile phone, for example) because they use GPS satellites to determine location. Peripheral WiFi use triangulation of access point, which is less accurate. If a device is connected via a cable (computer desktop for example), it will use the IP address, which is not at all accurate or completely wrong

    NB. the user must allow access to the API first, because of the risk of privacy.

    Demo:

    http://html5demos.com/geo

    --

    Kenneth Kawamoto

    http://www.materiaprima.co.UK/

  • I have 5 html pages that share a common header, footer and sidebar. How to use my navigation bar to change the content of the body without duplicating a lot of code?

    I have 5 html pages that share a common header, footer and sidebar. How to use my navigation bar to change the content of the body without duplicating a lot of code? Thank you!

    Read the help section of DW on models.

    Using Dreamweaver | Creating a Dreamweaver template

    Or use Server-Side Includes

    Nancy O.

  • How to use reveal all this without losing the work of culture?

    My workflow is to editing and cropping of images. I need the flexibility to perform any order.

    When I use the crop tool, I continue to delete the cropped Pixels unchecked. When I edit the images I want to edit the complete picture, not cropped image.

    If I use reveal all to make alterations on the full image after cropping, I lose my job of cropping. Is there a solution?

    How to use reveal all this without losing the work of culture?

    How to take a bath without getting wet?

    Enter drollery side you could use a path of access to store the current size before calling "Reveal everything", then later on the path as a selection of load, switch to the crop tool and hit.

    Or convert to smart object before you crop, then do the editing in the SO (it could be a potentially significant increase in file size, however).

  • How to use Javascript to loop through a tabular presentation

    APEX: 4.2.3

    DB: 11 GR 2

    Requirement:

    I have a master form / retail. We will see that master is the order information; Detail is the order lines. Detailed form is tabular

    The detailed form, there is an attribute called 'Line Order Qty' and the user can update this field.

    User can update all rows in the detail forms and change "line Order Qty' for each line. When the user click on 'Save' button on Master form, I have to do below:

    Sum of the 'line Order Qty' for all lines, and compare it to another field called 'Plan Order Qty' on the master shape.

    If sum 'Line Order Qty' > "Plan Order Qty", then it should appear a message with "Are you sure?" with two buttons on the message: OK and cancel.

    If users click on 'OK', the application will proceed and update another field called 'Sum of Order Qty' on the main form and the value set for the sum of "Online Order Qty" for all lines;

    If the user clikc 'Cancel', the application will be paused. The user must come back to change "Line Order Qty", and then try again

    given, I need a popup message when the validation, I think I have to write javascript; However, in the javascript code, I need complete all lines in detail (tabular form) to get the

    The sum of the 'line Order Qty'. Then I can compare the value and to launch the pop message if validation has failed?

    By reading this thread: building the perfect beast: Oracle APEX - Soft Validation using dynamic measurements

    I think I need to create a reference for action (DA) dymaic Javascript expression; However, in Javascript, how do I browse a table?

    Yet once, I need an example of using Javascript to browse tabular forms in the form master / detail.

    I don't know that my question should be raised before; but I can't find a good match of thread.

    Thank you!

    Kevin

    Hi Kevin Zhang,

    Sum of the 'line Order Qty' for all lines, and compare it to another field called 'Plan Order Qty' on the master shape.

    If sum 'Line Order Qty' > "Plan Order Qty", then it should appear a message with "Are you sure?" with two buttons on the message: OK and cancel.

    If users click on 'OK', the application will proceed and update another field called 'Sum of Order Qty' on the main form and the value set for the sum of "Online Order Qty" for all lines;

    If the user clikc 'Cancel', the application will be paused. The user must come back to change "Line Order Qty", and then try again

    given, I need a popup message when the validation, I think I have to write javascript; However, in the javascript code, I need complete all lines in detail (tabular form) to get the

    The sum of the 'line Order Qty'. Then I can compare the value and to launch the pop message if validation has failed?

    Follow the steps below

    Step 1: Change your page - > function and declaration of the Global Variable-> to insert the code below

    (i) f06 is here, the column on which I am looping the f06 column and enters the total variable to the value change in the values of the row that is changed by the user.

    (II) also replace your column with f06 markup on which you want to loop and calculate the total

    (III) assuming that P6_ITEM is the point where you plan_order_qty, replace with your article.

    (IV) SAVE this demand is what happens when OK is clicked, assign the request to process.which you give the floor to a click of the button SAVE the

    function update_order_qty () {
      var line_order_qty_tot = 0;
      $("input[name='f06']").each(function() {
        line_order_qty_tot += parseFloat($(this).val().replace(/,/g,''))||0;
      });
    
      var plan_order_qty = apex.item( "P6_ITEM" ).getValue()
    
      if (line_order_qty_tot > plan_order_qty) {
          apex.confirm('Are you sure?', 'SAVE');
      } else {
          apex.submit( 'SAVE' );
      }
    }
    

    Step 2: Edit the page-> Execute when loading the page-> to insert the code below

    \\calculate the total on change
       $("input[name='f06']").change(function(){update_order_qt();})
    

    Step 3: Change your button Save and put under the Action when the button is clicked

    Action: Redirect URL

    Target URL:

    javascript:update_order_qty();
    

    Hope this helps you,

    Kind regards

    Jitendra

  • How to use a function switch box to the reference that is used several times in the previous drop-down list options?

    I use JavaScript coding in LiveCycle and development of dependent drop-down areas, but I find it difficult to write correct code. See the example below. I'm trying to use a multiple box function that refers to an option that is listed several times in the previous pull-down menu. The problem I am running into is that when I refer to any color or Nissan and Chevy, it returns the results of the color in the "Ford" column only. I'll always see color (blue, black, green and purple) options in my second drop-down list and it seems fine, but then the third drop reference only the options and colors 'Ford '. (I don't have the code for the third menu list drop-down).

    I want the client to choose Chevy or Nissan and have her drop downs (based on the color they chose)-dependent, but I can't seem to make this work.

    I hope it is clear enough (probably as mud...). I would appreciate help!

    Form1. #subform [0]. #subform [1]. cboModels::exit - (JavaScript, client)

    cboColor.clearItems ();

    {Switch (this.) RawValue)}

    case "Ford":

    cboColor.addItem ("Blue");

    cboColor.addItem ("Black");

    cboColor.addItem ("Green");

    cboColor.addItem ("Purple");

    break;

    case 'Chevy ':

    cboColor.addItem ("Blue");

    cboColor.addItem ("Black");

    cboColor.addItem ("Green");

    cboColor.addItem ("Purple");

    break;

    case "Nissan":

    cboColor.addItem ("Blue");

    cboColor.addItem ("Black");

    cboColor.addItem ("Green");

    cboColor.addItem ("Purple");

    break;

    }

    Form1. #subform [0]. #subform [1]. cboColor::exit - (JavaScript, client)

    cboPrice.clearItems ();

    {Switch (this.) RawValue)}

    case "Ford":

    case "green":

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    break;

    case 'Chevy ':

    case "green":

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    break;

    case "Nissan":

    case "green":

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    break;

    }

    You can use '\n' for newline in a string, so

    "Option 1, \nOption 2, \nOption 3;

    Put each on its own line.

    Bruce

  • How to use Javascript to populate a text field based on a selection in a drop-down list?

    Greetings,

    I have virtually no experience with JavaScript and I'm trying to find a way to add some functionality to basic Automation to a form of Adobe.  I have a drop down box called "Hospital_Name" which will contain about 7 possible selections.  When the user makes a selection, I would like to have the field of text (called "Hospital_Address") under the drop-down list fill with the corresponding address to the selection.  I have the "Hospital_Address" text field set up for multiple lines and want the address to have a line break between the address and the city/province/postal code.

    For example, if the user has selected "Hospital 1", the text field would display:

    123 main St

    Anytown, CA 12345

    Help or you can provide examples would be greatly appreciated.

    'Re missing you the document level script that sets the data object and setItems function.

    document level JavaScript; Could be placed in the action open to the page if you cannot access the document JavaScripts level;

    Place all the pre-population data into a single data structure
    var Location = {}
    ' - Hospital - ': {line1: "', line2:" "" "},
    'Bellevue Medical Center': {line1: "2500 BMC Drive", line2: "Bellevue, NOT 68123"},

    "CHI Bergan Mercy": {line1: "7500 mercy Road", line2: "Omaha, NOT 68124"},
    'CHI Emmanuel': {line1: "6901 N 72nd Street", line2: "Omaha, NOT 68122"},
    'CHI Lakeside': {line1: "16901 Lakeside Hills Court", line2: "Omaha, NOT 68130"},

    'CHI Midlands': {line1: "11111 s. 84th Street", line2: "Papillion, DON'T 68046"},
    'Creighton University Medical Center': {line1: ' 601 n. 30th Street ', line2: "Omaha, NO 68131"},
    'Nebraska Medical Center': {line1: "4400 Emile Drive", line2: "Omaha, NOT 68105"}
    };

    function SetFieldValues (Hospital_Name) {}
    location [Hospital_Name] .line1 = this.getField("AddLine1").value;
    this.getField("AddLine2").value = location [Hospital_Name] .line2;
    }

    end document level scripts;

    custom script hits;

    If {(event.willCommit)

    If (event.value == "") this.resetForm (["AddLine1", "AddLine2"]); of other SetFieldValues (event.value);

    }

    end of custom keystroke script;

    Note the formatting of the elements in a column as a line we can help revise the code. Also use a text editor for processing code.

  • How to use a formula in column in the main query?

    Hi all
    I tried to use a formula columns defined in a query in the State of the query like this:
    where (: cf_ex -: cf_ex2) > = 5
    but when I run the report returned data! Why? and how to use the status of the query?

    Note: I'm using Forms 6i

    I gave you the reason:

    Formula columns are not part of the select statement (which runs in the database), but are dealt with in the report.
    So you actually reference the user settings in the query, not formulas columns.

    (Well, I should have said "you are referencing empty connection parameters", but with your experience you could have understood that)
    and the solution:

    Create database for cf_ex and cf_ex2 functions and use them in your application.

  • Qosmio F20-155: how to use BT to share files with the mobile phone

    Hello
    I HAVE TOSHIBA QOSMIO F20-155, BUT I DON'T NO HOW TO USE BLUETOOTH TO SHARE FILES WITH MY CELL PHONE
    PLEASE HELP ME

    Hello

    First a simple question: are you sure that your laptop supports Bluetooth?
    AFAIK the Qosmio F20-155 was delivered without the BT module.

    In addition, if you are not sure if the phone has BT then you can check the bottom of the unit. It should be placed a label BT if the Bluetooth has been installed.

  • How to use USB CAN 8473, code for the basic example

    Hi all.

    I use NEITHER USB-8473 CAN transmit and receive data via CAN.

    I have traveled a lot a lot of pages related to this and realized that the API will not work for USB - CAN. Can someone tell me please how to use this USB-8473.

    Maybe an exaple program would help me. (It is not PCI it we USB,)

    Thank you.

    You will need to install NI-CAN, if you don't have already done.  This is the API that you can use with a 8473.  After installing, open Explorer Measurement & Automation and make sure that you can see the 8473 under your devices.

    Here is a sample VI (LabVIEW 2009) that I wrote for another developer to make the CAN communication basic tests.  You enter a package CAN as a series of hexadecimal bytes separated by spaces, and it will send it to you.  It displays every CAN packet it receives in the same format.

  • How to use my laptop HP UK in the USA, I already have a universal adapter to connect

    HP G62 laptop

    Product number: XF230EA #ABU

    Operating system: Windows 7 64-bit

    I'm travelling to the USA, and I want to bring my laptop. I bought the laptop in the United Kingdom, I also have a universal adapter. How do I use it with my UK Plug and can I change adapter or converter.

    You must use a converter of pine with the universal adapter. See the following link for the view of this converter:

    http://www.Amazon.co.UK/US-UK-plug-travel-adaptor/DP/B0006OFKNC

  • How have use ACS supported wireless users and the VPN user?

    I'm new to ACS and configure the following requirement:

    (1) ACS to authenticate users wireless with window AD.

    (2) once connected successfully to the radio, the user must use VPN for remote access with the ASA.

    (3) the end-user will have only 1 common username but different password.

    for example:

    username: password: cisco: cisco wireless.

    username: cisco password: 1234 for VPN.

    ACS support can this, if yes how can we do? Do I need 2 sets of ACS?

    Yes, acs should work properly according to your need.

    ACS, we have a feature called NAP "network access profile" where we can define the condition based on ip source or attributes which allow to say if the request comes from wireless device acs will forward to AD and if the request is of the acs VPN will forward to this diff of database.

    Basically, we need to use two acs database.

    http://www.Cisco.com/en/us/docs/net_mgmt/cisco_secure_access_control_server_for_windows/4.1/user/NAPs.html

    Kind regards

    ~ JG

    Note the useful messages

Maybe you are looking for