Locking subforms

Does anyone know how to make all fields on a subform read-only without writing a script actually setting all the fields individually?

I believe that you have to loop through all the fields in the subform and set their "access" property to "readOnly". I don't know any other way.

Similar Messages

  • Check for required fields before locking subforms and submitting

    Hello,
    I have a 5-page form with many questions, to be completed by the original requestor and multiple approvers.  What I'm trying to do is have the original requestor's Submit button on p. 3 lock the input on the first three pages, but first check if all those fields have some content.  I currently have all the fields on pp. 1-3 set to "Required" in the object properties, but my script still locks them when there's is one empty one.  Here's what I have:
    //Lock portions of form
    Page1.access = "readOnly"
    Page2.access = "readOnly"
    Page3.access = "readOnly"
    //Save document, allow user to change name
    app.execMenuItem("SaveAs");
    //Submit via e-mail
    Submit_REAL.event__click.submit.target = "mailto:[email protected]" +
    "?subject=Subject text" +
    "&body=Message";
    Submit_REAL.execEvent("click");
    The automatic check for required fields happens after the pages get locked.  I would like the check to stop the process before it locks the pages.  Is there any way to check all at once that all "Required" fields on those pages have some content before allowing the script to proceed?  I know how to script it to manually check the 50 or so questions on those pages, but I would like to avoid that.  Thanks for any help.

    There are a few problems that I can see from the start. First, your code is going to pick up EVERY node that exists on these pages. Some of those nodes will not have a rawValue, and some will not have an actual name. As an example, you can take your code and create a text field to dump all of the names of the nodes that you get when you pull in all of the nodes this way. Here's an example:
    The result:
    Now, the question is, do you have a consistent naming convention for your fields that might be empty? That could be text fields, radio button lists, etc. For instance, I always prefix the names of objects in order to more easily keep track of what they are in scripts. Since I'm doing that, I can check the name of the field for tf, nf, rbl, cb, or whatever I have included to make sure that I'm checking an actual field before I check for things like rawValue.
    var nodeName = oNodes.item(nNodeCount).name;
    if (nodeName.indexOf("tf")>-1 || nodeName.indexOf("rbl") > -1 || /*check other field types*/) {
      //insert your code to check for empty answers here
    As for your line 7 issue. The syntax problem is that you've put extra parentheses in your if statement. Take out the parentheses that are just before and after the or "||".
    *This is my fourth attempt to reply. Something was going on with Adobe/Jive earlier, I suppose.

  • Populating fields, drop down lists, etc... from external data

    Hi,
    I am trying to evolve my forms, and am interested in learning how to connect my forms to external data sources.  I assume using server solutions would work, but are complex and costly.  They are also likely beyond my scope of understanding.  What are the best practices for doing this?  Can it be done with a text file or spreadsheet?  I am really looking for a better way to create custom data in forms than to go into the script and change them manually.  Price is a good example.  I have some forms that generate a very basic quote for services.  When the price of part x changes I need to going into the from chance the script for those items, re-save it and hope I have not missed any items.  Evey time his happens it is a hassle.  Not to mention if more than one user needs it I have to make sure they are all using the right version (to be clear I am less worried about this part as it seems a complex task).
    Is there a better way of doing this?  What are the best practices for this?  What external sources can be used to hold the data.  I would be interested in any tutorials that may exist on the subject as well.
    Thanks in advance for any/all help. 
    Tom
    P.S. it is amazing what LCD can do, and that I really enjoy working in it, although I have little background in scripting.  Great product and resource!

    Thanks Paul,
    I have been able to solve the drop down list question, thanks to your help.
    I have another question that involves locking specific fields in a four page form which contains approximately 100 fields that need to be locked before the end user completes the remaining fields. How do I lock individual subforms so that the remaining fields remain open and editable?  The final version of the form, will have at least 200 fields in it that will also need to be locked in sections.
    I can lock all the fields using the lock all fields button, but have been unable to make it work for just part of the form.
    I've emailed the draft form.  It would be really helpful if I had one example of a locked subform on the form I'm struggling with.
    Thanks for your help.
    Nellie

  • Drop down lists populating text fields on a page different from the dropdown.

    Hello all,
    I have a form with several pages. The first page contains a number of drop down lists. These drop down lists, when an option is chosen, is to populate a text field on another page. I can get the drop down list to populate the text field when it is on the same page, but as soon as I move the text field to another page, the script doesn't work. Can anyone offer a solution? I've used javascript on change for the scripts.

    Thanks Paul,
    I have been able to solve the drop down list question, thanks to your help.
    I have another question that involves locking specific fields in a four page form which contains approximately 100 fields that need to be locked before the end user completes the remaining fields. How do I lock individual subforms so that the remaining fields remain open and editable?  The final version of the form, will have at least 200 fields in it that will also need to be locked in sections.
    I can lock all the fields using the lock all fields button, but have been unable to make it work for just part of the form.
    I've emailed the draft form.  It would be really helpful if I had one example of a locked subform on the form I'm struggling with.
    Thanks for your help.
    Nellie

  • Field alignment gets locked to top-left for last field on subform

    Periodically I experience a problem with the last field on a subform. Whatever field alignment I set using Output Designer, when central pro processes the data the and aligns the data topleft. This is a particular problem when outputing financial data which I need to right align because the number of digits before the decimal point is variable. I usually work around this by adding dummy fields at the end of the subform, but this does not always fix it.
    Any ideas as to what causes this? (so that I can avoid it)
    Or any software fixes for it?
    Are there any tools for examining the content of the .ifd or .mdf files, as this may through light on the cause.
    Adobe Central Pro Output Server version = 5.5 (also affects 5.4)
    Presentment target = PDF
    Windows version = 2000 professional
    Many thanks in advance, Stephen

    Thank you for the feedback.
    I have changed a some of the field positions/widths and changed the alignment from top-right to middle-right and the problem seems to have gone away.
    I could not see a way of determining the printable regions of the page. The output I am crfeating is a PDF file.
    I am still concerned that I don't understand the problem well enough to avoid it in the future.
    Stephen

  • How to lock a form (all fields read only) using a button (JavaScript)

    Hi guys,
    I have a form with several input fields, check boxes. Using a button in the form, I would like to lock it using a JavaScript. Locking means in my case that all input fields, checkboxes, etc. are read only (cannot be changed anymore).
    I already use the following approach:
    data.form.MyInputField.access = "readOnly";
    The problem is, that this approach is not comforable from maintenance perspective. I would like a more generic or more simple way.
    Generic:
    loop over all fields and set them to "read only"
    Simple:
    xfa.form.lock; // but this does not work
    Do you have any ideas how to solve this requirement in another way as I currently do?
    Thanks,
    Thomas

    Now I used the following script:
    // set the whole form as container
    var objContainer = data.Report;
    // call the method to set all fields to read only (recursion)
    disableAllFields(objContainer);
    function disableAllFields(objContainer) {
         for (var i=0; i < objContainer.nodes.length; i++) {          
              switch (objContainer.nodes.item(i).className) {
                   case "field" :
                   case "exclGroup" :
                        objContainer.nodes.item(i).access = "readOnly";
                        break;
                   case "subform" :
                        disableAllFields(objContainer.nodes.item(i));
                        break;
                   default:
    It works but is there another possibilitiy such like
    form.lock;
    Thanks,
    Thomas

  • Lock/Password in pdf of Adobe forms

    Hi,
    I want to include password /lock concept means when user run the program the pdf should be downloaded with password. so that only the person who runs the report can able to see the output using the password

    Hi Anurodh,
    Just do the following:
    1. Put all the subforms in a single subform your pdf form.
    2. Create another subform to get password from user. On it create a password field and a button.
    3. Now suppose in your pdf the main subform let 'A' contains subforms A1, A2, A3. A3 is password form.
    4. Then write the following code in the form:ready event of the A:
    $.A1.presence =  "hidden"
    $.A2.presence =  "hidden"
    5. Write the following code in the click event of the button on the subform for password i.e. A3.
    if( PasswordField1.rawValue == "password" )
    then
    A.A1.presence = "visible"
    A.A2.presence = "visible"
    $.parent.presence = "hidden"
    else
    $host.messageBox("Wrong Password!!!!!")
    endif
    Hope it will help to create a password protected pdf form.
    Regards,
    Vaibhav Tiwari.

  • Locking Selected Fields on Submit

    Hello,
    I've been working on a multiple-item quote request form. My intention is that Party A (Requestor) will fill in the item description and details necessary for Party B (Vendor) to provide a quote. The form will be emailed to the Vendor who will complete the remaining fields (price and delivery) and email the form back to the Requestor.
    The item description and details (provided by Requestor) and the item price and delivery (provided by Vendor) are both wrapped in thier own subform and both are contained in a repeating subform. I've scripted the buttons that add/delete instances of the subform for each separate item being quoted and the button that emails the form to the Vendor. It took me a long time, but I finally got the buttons to work!
    Now I'd like to find a way to 'lock' the fields filled by the Requestor when the form is emailed but still leave the fields open that need to be completed by Vendor. I'd also like to lock the contact information fields at the top at the same time. I've attached a JPEG with the form layout to clarify...
    I've been reading a lot of old posts regarding similar topics and tried some of the solutions provided but cannot seem to make them work for my application. The closest I've been able to come is locking the entire form. I have the form set to email on event=click of the "Submit to Vendor via Email" button and the locking action on the event=mouseup of the same button.
    Does anyone know how I should approach this? I'm begining to think I designed my form and myself into a corner! Unfortunately I do not have a server on which to host the form but would be happy to email it to anyone willing to help.
    Thanks,
    Jake

    I dont know what I was thinking.  After some rest, and a second look, I can see this what the code is doing.
    I am trying to provide a button that will lock elements on individual pages that are part of multiple instances. Note, each instance will contain said button.
    Example: TRANSMITTAL[3].lockButton should only lock items on that instance of  TRANSMITTAL[3].
    The two attempts had different results
    form1.TRANSMITTAL.lockButton::click - (JavaScript, client)
    var j = _TRANSMITTAL.count;
    for (var i=0; i<j; i++){
         var currentSubform = xfa.resolveNode("TRANSMITTAL[" + i + "]");
         varLOCK.LockAllFields(currentSubform, "Lock");
    ..resulted in Locking ALL instances.
    form1.TRANSMITTAL.lockButton::click - (JavaScript, client)
    varLOCK.LockAllFields(form1.TRANSMITTAL);
    ..resulted in nothing.
    Any suggestions?

  • Lifecycle designer 8 Field Locking question

    I have created a Remote access request form that is sent out to people when they need to connect to our network remotely. the form asks them to enter their contact details (Text field) and i have also created a table that asks what server they need access to (drop down list). However i also have text fields next to the drop down list. The user is only supposed to fill out their contact details and server name fields, then send it back to me and i will issue them an ip address, password etc. I will then save the form and send them a copy for reference. What i would like to do is lock down the form so they can only enter data in certain fields, but when it is sent back to me i can fill in the rest of the fields, ( ip address, password fields etc). Choosing to lock down a field after signing isn't any help to me because when they sign it and send back to me i want to be able to enter the rest of the information.
    Is there any possible work around to this.. how will the document know who has full access to it?
    Cheers,
    Dan
    IT Admin
    FEA LTD.

    A couple steps have to be made to have your form expand. Make sure when you save the form, it is saved as "Dynamic" and not "static".
    Also, make sure you click "Expand to fit" under "Height" in the Layout tab.
    If you want everything below your "expandable" section to move down, you will have to make sure all of those parts below are "wrapped" in a subform and the content is set to "flowed". You can wrap a "positioned" subform in a "flowed" subform.
    I hope this is some what helpful and understandable.

  • Dynamic Forms with Subforms and Text Fields

    I've been reading all of the messages relating to subforms and dynamic forms and have used many of the suggestions, but haven't found anything that addresses the problem I am having. I'm using Designer 7.0. I've saved my form as a dynamic form, I've set my text fields for multiple lines and expand to fit. My problem is that as soon as I set the parent subform to Flow Content, everything moves to the left margin. I've tried grouping items together within a subform in hopes that the items will maintain their position on the page, but everything always moves to the left margin. I'm creating a legal form that needs to have text and a text field centered at the top of the page. Below that to the left is a text field that needs to be able to expand with two text fields to the right of it. Below that are additional text fields that need to expand as needed.
    Am "stacking" my subforms incorrectly and setting the wrong subform to Flow Content? Or, can you now lock a field to a specific position? Any help would be greatly appreciated.

    Unfortunately, I hadn't understood that you needed the fields to expand in height and everything below them to move down the page. In that case, you'll need to use flowed subforms.
    Having all objects move to the left side of the page is expected when setting a subform to flowed. That's because the flow is top-down, left-right.
    One thing you could try is making the text field that needs to be centered exactly as wide as the flowed subform and then setting its left- and right-hand margins to an equal number. This would ensure an equal amount of space on the left- and right-hand sides and because the field would be as wide as its flowed container (subform), entering multiple lines of text would result in everything below moving down.
    I've attached a sample form where the page subform has been set to flowed, the text field at the top is a multi-line/height-expandable text field with its width set to the page width and its left- and right-hand margins both set to 2in and the button and check box objects are pushed below the text field.
    When text is entered into the text field, it expands in height and causes the button and check box to move down.
    To achieve other horizontal and vertical positioning/offsets, you could play with the margins of all the fields that need this.
    Stefan
    Adobe Systems

  • Lock current date after save

    In the form I am working on I have a current date field.  When the user saves the form I would like that date to be locked so when the form gets emailed to me and I open it, I can see whent the user sent it.
    Is this possible?  Any help would be great.

    Still having a problem....not working.  Next time I open the form (I've forced a date change on my pc) and it changes to the current date.  Is this correct?
    form1.#subform[0].CurrentDate::preSave - (JavaScript, both)
    if(this.value!=null)
              this.access="readOnly";

  • Targeting all objects in multiple subforms with a shared name throughout a form

    Hi
    Jono Moore was able to find an excellent solution from an original by Radzmar for targeting subforms throughout a form that share a name:
    function hideSubs(vNode) {
         if (vNode.className === "subform") {
              //name of subform you're targeting
              if (vNode.name === "targetSub") {
                   vNode.presence = "hidden";
         for (var i = 0; i < vNode.nodes.length; i += 1) {
              hideSubs(vNode.nodes.item(i));
    hideSubs(xfa.form);
    Has anyone any thoughts on how to extend this functionality to select the object within those subforms?
    So:     (1) find all subforms with the shared name (a solution above), then
              (2) select all objects inside those subforms only (all types: text fields, radio buttons, check boxes, etc.).
    The intention is to lock these down and to apply a colour change (from white to grey) as a visual cue. The solution above allows the background colour of the subforms to be changed, but what is required in this case is a colour change to the value backgrounds of the objects within those subforms only.
    Any thoughts grately appreciated.
    Thanks

    Francis play around with the above code, it's a simplified version of the script you are using.
    I've used that node traversal script for a bunch of stuff myself but I'm trying to wrap my head more around Radzmar's simplified version as it looks like it would be a lot faster for larger forms. And it's getting into areas I don't know much about so I'm learning stuff too!

  • Protecting multiple instances in a subform

    Working on a form which I want to access protect various subforms with a password that the user creates.
    The script works ok apart from the AM11H.sfContent.sfRows subform, where it only protects the first instance. All other instances are unprotected.
    var pword = AM11H.sfContent.sfPassCode.txtConCode.rawValue
    if (AM11H.sfContent.sfPassCode.txtConCode.rawValue == pword) {
            AM11H.sfContent.sfProperty.access = "protected";
            AM11H.sfContent.sfNoAccess.access = "protected";
            AM11H.sfContent.sfRowHead.access = "protected";
            AM11H.sfContent.sfRows.access = "protected";
            AM11H.sfContent.stCompletedBy.access = "protected";
    Can anyone help me with the script to lock all the instances of the AM11H.sfContent.sfRows subform. There are some 15 fields in the subform.
    Thanks. 

    You need use this for example:
    var numInst = AM11H.sfContent.instanceManager.count;
    if( numInst > 1)
         for( var i = 0 ; i < numInst ; i++ )
              xfa.resolveNode("AM11H.sfContent[" + i + "].sfProperty").access = "protected";
    else
         AM11H.sfContent.sfProperty.access = "protected";
    ZAMPAZAMPA

  • Disappearing Subform

    I've created an interactive dynamic form that shows or hides subforms based on
    a selection from a drop-down menu.
    The drop-down menu has 10 "List Items" and each List Item has a corresponding subform.
    Each subforms presence set to "Hidden (Exclude from Layout)."
    The subforms are made "visible" or "hidden" using the following JavaScript:
    if ("RMC-Guernsey-PLD DOT" == xfa.event.newText)
        GU_ML.presence = "visible";
    else
        GU_ML.presence = "hidden";
        GU_ML.rawValue = "";
    This script is repeated 10 times, once for each list item and subform.
    The form fields are locked via a digital signature and the form is submitted as a PDF using an e-mail submit button.
    At this point everything looks fine.
    The problem is when the form is re-opened. The subform made visible from the drop-down menu is no longer
    visible, but is hidden and excluded from the layout.
    How do I keep the subform visible?

    On the form properties page under the Defaults Tab make sure that the option to preserve script changes is set to automatic and not manual.
    Paul

  • Off Line Adobe Form has to be Locked

    Hi Gurus,
    I have a requirement in Off Line Adobe Forms.
    We are sending a Adobe Form to user through mail.User is trying to edit some data by using Acrobat Writer. So client is asking to put a restriction/protect/Lock to the Form.So that user can't edit anything.
    I don't want to use password Protect method.
    I want to use this syntax,but not sure as I don't have Acrobat Writer : form.sf1.access = "protected"; // or use readOnly.
    Please suggest me as this is very urgent.
    Thank in advance.
    Regards,
    Bharath

    hi,
    Page is nothing but a subform. like u hide a subform on a page. you can also hide the page itself by using the presence property.
    instead of hiding the individual subforms. hide the page as complete.
    it works. i have tried it.
    Regards,
    sakshi

Maybe you are looking for

  • Download Excel file through Web dynpro with no windows open?

    Can we have a web dynpro application that just returns an Excel file in the response with no open windows? Similar to a java servlet that is used to download a Excel file? This basically means that I cannot use wdComponentAPI.getWindowManager().creat

  • Data Recovery on Failed Drive

    My son's iBook hard drive died with all his graduate school work on the drive. Apple is going to replace the drive under AppleCare, but we're trying to see how to get valuable files off before sending to Apple. DiskWarrior stalled. It was showing a S

  • Apply gradient to flex applicationBar

    hello guys i 'm trying  to port an application from flex 3.5 sdk to flex 4.5 however im having problems with styles. for example on applicationcontrolbar in my css i used to be able to do this. ApplicationControlBar.appBarDayCell{ fillAlphas: 1.0, 1.

  • How to reach Struts variables in a JSP scriptlet?

    hello! First I would like to clarify, I know writing scriptlet code (eg database connect) in a JSP page is basicly wrong, but I have to make a project that way, because my Java teacher asked so. My problem is the following: I have a struts-config.xml

  • Photo download to PC

    My PC will not identify my iphone4 although I can sync it through iTunes. I cannot therefore use my recently installed Adaobe Photoshop Elements 9. Software is 4.3.3. Any ideas.