How to hide fields according to their name (by using a loop)?

I have a form that will require several fields to hide when the user first loads the form. I would like to automate that with a JavaScript loop where if the value of the object name starts with 'hidden' his presence 'Hidden '.

I found the script below in the ES4 LiveCycle documentation, but it does nothing. No error was reported in the JS console. In which case the loop must be added to? The form parent? The syntax is correct for what I want to achieve?

for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) {

    var oFields = xfa.layout.pageContent(nPageCount, "field");
    var nNodesLength = oFields.length;

    for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
        if (oFields.item(nNodeCount).name.substring(0,3) == "hid") {
            oFields.item(nNodeCount).name.presence = "hidden"
        }
    }
}

Thank you!

Hello

On line 8, you need to delete the name of '. ', the presence is a property of the field, not the name. Then;

oFields.item (nNodeCount) .its presence = "hidden".

You can place this code in the subforms docReady event of the page, or perhaps it would be better in a macro, so that the fields are hidden at design time?

Concerning

Bruce

Tags: Adobe LiveCycle

Similar Questions

  • How to hide e-mail records when accessing content using WebDAV?

    Hello

    We use the hive as IMAP server, and we want to start using it to store files and documents. One of the questions that we found is that booty shows the user e-mail files in the WebDAV folder. How to hide these files to users?

    Kind regards
    Miguel

    Hello Miguel.

    You can't have that. However with the hive, we can store the document in the Inbox folder or create a subfolder containing document - even if it is unusual.
    So if e-mail folders are hidden you will not be able to access documents potentially stored inside.
    However, if this is a real problem, you can always open an enhancement request.

    Kind regards
    Fred

  • How creat text field on the time of execution

    Hello.

    How to creat text deposited the time of execution using the loop?

    Can u please help me?

    Thank you

    Jaxna

    Or make them more effective declare the TextFormat only once.

    var aTexts:Array is ["hi1", "hi2", "hi3", 'hi4', 'hi5', "hi6", "hi7", "hi8", "hi9", 'hi10'];.

    var myTextFormat:TextFormat = new TextFormat(); for the style of text

    myTextFormat.size = 12;

    myTextFormat.align = 'left '; left, right, Center

    myTextFormat.color = 0xFF0000; Red

    for (var i: Number = 0; i<10;>

    {

    var nDepth:Number = this.getNextHighestDepth ();

    var nX:Number = 10;

    var nY:Number = 20 * i;

    var nW:Number = 300;

    var nH:Number = 30;

    var myTextField:TextField = this.createTextField("hello_txt",0,10,10,100,20) ("txtField" + i, nDepth, nX, nY, nW, nH);

    myTextField.text = aTexts [i];

    myTextField.setTextFormat (myTextFormat);

    }

  • How show/hide a field?

    I'm trying to understand how toggle a field called "Aircraft" as hidden or shown, according to the text entered in another field called 'Trip '. If the value of 'Trip' is empty, I need air ' "hidden - this field is a calculated field based on the data entered elsewhere. Also, if the person changes the entry in the 'Trip' to something else that a white - I need to hide/show to switch to show - and if they delete the entry to switch back. In other words, people often change their minds and I need the "Airfare" field to account for that.

    Hope it makes sense.

    Thank you.

    It's pretty simple to do manually with a bit of javascript, for example-

    It should work OK.

  • Change the field values of multiple text searching a word/words in their name.

    Hello

    So in my document, I load all the text fields roughly the same name than just with slight variations in their name.

    For example:

    FldTxt

    FldTxt1

    P1. TemplateName.FldTxt

    P1. TemplateName.FldTxt1

    ... Etc.

    The way this works is that each individual text box represents a parameter for a single element, so in this case there are 4 products.

    Is the way in which these parameters are selected, the user presses a button that generates a copy of a template page.

    On this page are a group of checkboxes, buttons and drop-down lists, these particular text fields display the value of a drop-down list.

    This is so that when the user has finished with the generated page, it can be removed and all the information is stored on the main page for later in the process.

    Because of how the elements of work means that fields can either displays a 'None selected' or option selected, BUT they cannot stand by the option that was selected.

    For example;

    FldTxt "none".

    FldTxt1 "selected Option2.

    P1. TemplateName.FldTxt "selected Option2.

    P1. TemplateName.FldTxt 'None Selected '.

    I hope this explains the theory behind it.

    So I wonder is what I could put these text fields values by searching for a keyword in their name? For example. If the field has "FldTxt" in its name, and its value is not equal to "None Selected", change its value to the value of the drop-down list of the most recent.

    The reason why I want to do it in this way is because there is no predefined number of these text fields, there might be only 2 or 200 because it depends on the number of items in the form.

    So I imagine it would go something like this;

    for (var i=0; i<this.numFields; i++) {
        var f = this.getField(this.getNthFieldName(i));
        var nameSearch = //search for keywords in a field name
        var dropdown = //the name of the dropdown
        if (f.nameSearch == "FldTxt" && if f.type = "textfield") {
            if (f.value !== "None Selected") {
                f.nameSeach.value = dropdown.value;
    

    My apologies if the syntax is incorrect or even impossible, but I don't know exactly what I'm asking check I just know what would be the outcome.

    I know that we can search for words in a document so I wonder if it is possible for domain names

    Your code is not quite correct. If I understand this code should do the trick (you may need to adjust the names of fields and values, however):

    var nameSearch = "FldTxt";
    var dropdown = this.getField("Dropdown").value;
    for (var i=0; i		   
  • How to hide the names of the recipients when I send an email to many people?

    I'll send a message to a lot of people I know, and I think that some of them would rather not showing e-mail addresses. How to hide the?

    You use the BCC (blind carbon copy) field instead of the CC field to prevent one of the most complete list.

    Probably there is a button on the edit page to reveal this field.

  • How to hide the credit card fields when PayPal is selected in the layout of catalyst fund business

    Who need to learn how to hide the fields of PayPal credit card is selected in the layout of the entry of catalyst business. Some old messages from Adobe (2012) on this subject has not provided clear solutions. Layout options page BC number of registration or the tutorials of customization that I could find. Can you please point me in the direction or there may be a few simple html, css, javascript that would do the trick. Thank you

    The script of BC for this form does by default. If it does not that this code may have removed or you have a form of script errorr there.

  • In adobe Captivate, I wish that the person taking the quiz to write their name and then the name is displayed on the page of the score.  Someone knows how to do this?

    I have the lessons created using Captivate using my high school students.  I would like to the student taking the test type in their name and make it appear on the page of the score so that they can not share the results.

    Otherwise, children can make these for HW and share with their friends.

    Thank you

    Moved Forum of cloud.

  • How to hide a label for a field view-only

    I have an element display only with its label in the above position. The use of JavaScript, I am applying the. style.display = "none" method for this item. Although this method hides the value of the element, it does not hide the label. How to hide the label as well?

    Apex 4.1.1.00.23

    Hello

    You can modify the display element only.
    In the Add Label section-> attributes of HTML table cells:
    ID = "labelid.

    Then just call in your javascript:
    $x_Hide ('labelid');

    Kind regards
    Aljaz

  • You can use Windows Explorer (in Windows XP) to view my files according to their DATE OF PUBLICATION (rather than the date of creation or modification).

    I have a lot of cuts in MY Documents. They are variously in format (TXT, WORD, and PDF). Using Windows Explorer, I know exactly how to display these documents based on their date of creation or update. But how to display these documents based on their release date.

    (1) there must be a way to set "date of publication" as a property of TXT, Word, and PDF files.

    (2) there must be a way to display in chronological order the files in Windows Explorer - not according to their creation or modification date, but according to their date of publication.

    Can someone please? Maybe someone write an essay with many historical sources can feel my pain. I was playing with MS Word properties and trying to create custom, attributes but so far I still did not understand how to format a) correctly a new attribute for b) search for this custom in Windows Explorer or the Publication Date attribute.

    In short, I want to see all my files, because they have been published so that I can have a "timeline of events" outcome of saved newspaper clippings.
     
    Rabindra

    Name/rename the files with numbers on the front of the file name; for example, 01-11-2009 - historicaldocument1.doc, 02-13-1957 - historicaldocument2.doc. There is no way for Windows can read the text of a file whether it refers to the great Chicago Fire what on such and such a date.

    If you are doing historical research, you can check on some forums/newsgroup user on your particular area to see if other people use the documents management software. It would be the best way to go. MS - MVP - Elephant Boy computers - don't panic!

  • How to make reference to a column name in the form report

    Hello
    How can I make reference to a column name in the form report. My problem is that "I have a form report that I have the column name when using click on the column name, it must get to the next page with the corresponding values of the column".

    Here, I realized that when I click on the name of the column (in page 1) it brings me to the next page (page 2). but in the next page (P2) I want to display (display only) the corresponding values of the column (page 1) selected, but the values are not editable and shouldn't be in the text box must be in display area.

    So, how can I write a SQL to display single source field. That is to say, how can I consult report form (page 1) in name column.

    Hello

    If you use the link in the column when you click on the need of the column value, you need to navigate to the next page and all the data accordingly select value here.

    Modify the report form and see the top of the page and click on report attribute.

    So now you have the attributes of the columns is to say what are the columns are available in the reports form.

    Click on change column what you need Ie the column when you click on its passage to the next page this column, for example, as mentioned in the previous post "Empname".

    Check the link column and give perspective of values according to your need and click on apply chages.

    Thank you & best regards
    Srikkanth.M

  • Assigning images to the grid according to their value random number cells?

    Hi all!

    I need a good point (or push) in a good way.

    Background

    (With previous assistance from this forum), I created a random number of 12 x 9 grid that scrolls the numbers 1 to 9, a total of twelve times each. Then I created a button that mixes the current grid cells whenever it locks. I now want to use 9 images that I imported as individual symbols in the library (I gave them each their own class called "skin1," 'skin 2',...) "skin9") as the cell labels or equivalent. I also created images as individual video clips (using the.) The class Sprite as extended but base class keeping the real image of class names in line with the name of the object, i.e. the "skin1" image is the class "skin1.as").

    Question

    How can I assign these images for the cells in the grid according to their respective values (from 1 to 9) and ask them to fill the grid, whenever I click on the button 'shuffle'? Thus, for example, in my grid numbers 1 to 9 randomly appear 12 times each. Whenever the number 4 appears in a cell, I want it to be assigned to the picture "4 GB" (which is just a chart that looks like a button and has a fancy number '4' printed top). Here's a piece of code that I use to draw the grid cells with:

    // Creates a grid cell when called by generateGrid().
    private funciton drawCell(_numeral:int):Sprite
    {
         /*
              This is the code I am currently implementing to populate the grids with (although I
              don't want to use text labels as I want to fill each grid with an image according 
              to its numerical value (1 to 9).
         */
         var _label:TextField = new TextField();
         _label.multiline = _label.wordWrap = false;
         _label.autoSize = "center";
         _label.text = String(_numeral);
         // Add numerical label to cell array.
         cellLabels.push(_label);
         var _s:Sprite = new Sprite();
         _s.graphics.lineStyle(2, 0x019000);
         _s.graphics.drawRect(30, 0, cellW, CellH);
         _s.addChild(_label);
         return _s;
    }
    


    While what follows is not the labour code, it will show if all goes well I want to reach inside this function so I can't use the code snippet above to the text labels:

    This will create "if all goes well" a table of 9 images by calling their classes.      var _imageArray:Array = [skin1, skin2, skin3, 4 GB, skin5, skin6, skin7, skin8, skin9];      That's what I want to get for each cell using the matrix in the image above: for (i = 0; I < cells; i ++) {if (_numeral == 1) {/ / Insert image skin1 for each instance of #1 in the grid.}}           } If (_numeral == 2) {/ / Insert image skin 2 for each instance of #2 in the grid.}           }... If (_numeral == 9) {/ / Insert image skin9 for each instance of #9 in the grid.}           }      }

    Again, I want not to use text labels. I have a skin graph custom that I want to go over each number on the grid, based on its value (from 1 to 9). Help with this is greatly appreciated!

    :

    // Creates a grid cell when called by generateGrid().
    private funciton drawCell(_numeral:int):Sprite
    {
         /*
              This is the code I am currently implementing to populate the grids with (although I
              don't want to use text labels as I want to fill each grid with an image according
              to its numerical value (1 to 9).
         */
         var _label:TextField = new TextField();
         _label.multiline = _label.wordWrap = false;
         _label.autoSize = "center";
         _label.text = String(_numeral);
         // Add numerical label to cell array.
         cellLabels.push(_label);
         var _s:Sprite = new Sprite();
         _s.graphics.lineStyle(2, 0x019000);
         _s.graphics.drawRect(30, 0, cellW, CellH);
         _s.addChild(_label);
    
    var classRef:Class=Class(getDefinitionByName("skin"+numeral));var image:*=new classRef();_s.addChild(image);      return _s;
    }
    
    
  • Adding dynamic text; How can I stop the projection variable name?

    I create a simple game for children.  On the first page, I added a "text input" field for his first name.  I called the firstname variable.

    When they move to the next page, I used a 'text dyanamic' field so I can call by name on this page.  This works.  However, when I test the game, on the first page, where the first name is entered, it shows the _level0.firstname instead of just a blank for them to enter their name.

    I know I've fixed this in the past and it was something simple, but I don't remember how to do it.  I would be grateful to anyone who helps!

    Thank you.

    do not assign a variable name for the textfield object. or, at least, do not use the same name of the textfield variable and instance name.

  • I can't tag friends on Facebook by typing in their names

    In Firefox for my office (Linux Mint), I am able to enter a person's name and mark in a message or a comment. For example, when I type in my wife's name he his tag in the post/comment and her report just him in a message/comment. I am also able to do it on Facebook using Chrome for Android mobile site. Unfortunately this behavior does not occur in Firefox on my Android phone.

    I thought it might be my modules (I use Adblock Edge and Ghostery), but I uninstalled both and I always feel the same behavior (or lack thereof).

    Anyone know what could be causing this?

    I found a way to solve this problem. Install the add-on false (which allows to change the user-agent string) and set the Firefox OS user agent string. Then re-load Facebook mobile site. You should be able to tag people by entering their name now.

    So it doesn't seem to be a JS issue, it seems to be how Facebook makes the site for Firefox for Android. If do you think that you use something else (for example Firefox OS) it renders properly.

  • After update 24.4.0 (Linux) the Inbox, Sent, Trash, Outbox and project files appear with their names in English, instead of my locale.

    After Linux Thunderbird updated to 24.4.0, records 'system' (smells, Trash, Inbox...) now appear with their names in English, instead of in my locale, as they appear in the previous version.

    How to 24.4.0?

Maybe you are looking for

  • I can't find the start page in Firefox with the Set Up synchronization link

    I try to get the synchronization on my android device code find all my favorites on my main computer to the tablet-PC. The directions on the Mozilla support site say "Type set up button on the start page for Firefox Firefox Sync." Well I can not for

  • Why is there a space to the left of the URL in the navigation bar?

    I use Firefox 24.0 (current version) on Windows 8. There is an excessive amount of whitespace to the left of the url. Why is that? Is there a way to justify the url to the left? I'll post a screenshot below.

  • Satellite Pro P200 PSPB7E - I need some drivers XP

    Hello world First of all, I would like to say that this forum is so great, because after fighting for a week trying to install XP, I had finally finished it, however now comes part 2 of the problem :( Before I installed XP on my system I did so that

  • Sony UWA-BR100 Wireless USB stick.

    Hello. I bought a Bravia a year ago, which was ready wifi. I also bought a USB stick for wireless Internet. After a year Flash DRIVE suddenly stopped working. It was quarrantee anger so I had to pay for a new. I searched many shops plus some Internet

  • HP Officejet Pro 8600 Fax (CM749a) Email problem n911a

    Hello! I use a HP Officejet 8600 aio n911a (CM749a) connected to a network via ethernet. My fax machine is currently set to 'Fax to Network Folder', but I would like to change this to 'Fax to Email. I went to the Fax tab and clicked on the HP digital