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

Similar Messages

  • How to Conditionally make some standard fields read only in OSC Simplified UI?

    Hello everyone, We have a requirement to make certain group of fields read only based on the value in another field. For example if the status changes to "Closed" then make the Name and Address fields read only. All these fields are standard fields. Is this possible in Oracle Sales Cloud?

    Post your problem in the forum for LiveCycle Designer.

  • How to save a Form as a read-only pdf?

    I created a form in Acrobat X. I need to be able to send this form to some of our team members so they can fill out and save it as a read only file that can then be sent to customers. How can I do this?

    Reader 10/11 has a means to flatten a form as part of the EchoSign e-signing tools. They could fill-in the form and select: Sign > I need to sign > Signed. Proceed to Send > Save a Copy
    You'll just need to instruct your team members how to do this. It is more secure (for lack of a better term) since it removes the form fields but leaves their appearances, making it more difficult for someone to change. Most people wouldn't know how to change the values of read-only fields, but it's quite easy for someone who does.
    This option won't be available if the document is Reader-enabled, but if your team members are using Reader 11 they will be able to save a form without it being Reader-enabled.

  • How to make few DFF fields read only in Forms

    Hello.....
    I am having an Issue in forms customization through custom.pll
    I need to make few DFF fields read only in HRMS enter and maintain form through custom.pll
    I tried with fnd_descr_flex.update_definition but in vain
    So please help me how to rectify this issue.
    Edited by: user.nazeer25 on Jul 9, 2010 5:27 AM

    Hello,
    Wrong forum.
    Ask this kind of question in the E-Business Suite forum ;-)
    Francois

  • How to make fields Read only on all tabs in one go with the help of feeder classes in SAP EHS?

    I have a requirement where once we press SAVE button i have to make all the fields read only in tabs highlighted below.Which is the best method to do it.?
    There are number of fields in all these tabs and we want to make them read only on particular Action event.How to do it?
    Thanks,
    Vimal

    Hi Vimal,
    As I understood you reformulate this question at this page. I will try to help you there.
    Kind regards, Aliaksandr.

  • How to make form field read only for users with certain permissions

    We need to make two form fields read only for users with certain permissions. Kindly guide me on how to do this in Infopath. I searched and there is an option to disable to the column, but no option to select user permissions. 
    Please give your suggestion on this. 
    thanks.

    Hi,
    See the link below:
    http://info.akgroup.com/blog-0/bid/69277/InfoPath-Restrict-visibility-to-users-in-a-SharePoint-Group
    Here you can add the fomatting action on the field to disable the field if those users belong to certain Sharepoint group (does not matter the permission levels though). Hope it helps.
    Regards, Kapil ***Please mark answer as Helpful or Answered after consideration***

  • How to make fields read only after form is filled in

    I am creating forms to be used within our company.  The customer srv representative (CSR) would fill in the form and send it to the customer for signature and initial.  There are a few issues I can't solve.
    1)  I need to make the rate & services fields read only after the CSR initials the form

    Will the CSR have Acrobat or just Reader, and what type of computer will the CSR be using (Windows/Mac/mobile OS)? If just Reader (Wind/Mac), this is possible by setting the fields to read-only with JavaScript. The problem is this can't be considered secure, even if using a password as discussed here: Password-protect and hide one form field
    With Acrobat you have the ability to flatten certain fields, which makes it a bit more difficult to change the "fields".

  • I created a Custom list New Form and need to make the text fields read only

    When I use SharePoint Designer and add the read only attribute  to the  SharePoint form field, then it throws  a web part error.
    but here is the thing, I have current user Filters populating the Form Fields. So the form fields  populate First name , last name etc. and I need these fields read-only....
    the Client doesn t want the end user to Change those fields.  Is there any way to "LOCK" the form fields?
    As I have only 7 text fields that need to be locked down. and one field is a signature line that is a true input field.. where the  user has to inter their initials.
    Any ideas? as I have tried most of the items available thru searches nothing works, or it throws that web part error message.
    Steve Athey

    Daniel: ( I'm now at work, a different ID is logged on for me)
    I used SharePoint Designer.
    Steps:
     created a web part page
    then on the SharePoint Designer ribbon I then went to insert:
    new item form
    Then I selected my data source (list)
    then I placed the 8 columns on the page
    a page viewer web part to pull the manual that people have to read.
    and 7 current user filter webparts. (1 for each form field) Yes it is over kill, but I'm trying to keep this straight out of box as much as possible...
    then for the form fields
    I added a parameter and the read only tag see below in bold:
    <asp:TextBox runat="server" text="{$ParamEmployID}" id="ff17{$Pos}" __designer:bind="{ddwrt:DataBind('i',concat('ff17',$Pos),'Text','TextChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Employee_x0020_ID')}" 
    ReadOnly="True" />
    I also  added the parameters in the ribbon area
    the error message doesn't tell me much, it just send me to web part maintenance page... 
    if I removed the  ReadOnly = True then the error  goes away.....   So I was trying to find a  quick simple  JQuery and or javascript   code item that would  make  the 7 text fields readonly and leave the
    8th  text field alone  to allow people to place their initials on the page to say that they read the manual.
    I have  created hundreds of these types of pages .. this is the first time I have run into this issue, but it also the first time I have tried to use the ReadOnly = True item.
    Any Ideas  and or thought on how to make the  items read only? and not throw the error.
    Steve

  • How to make users to select the date from calendar control my making the date field read only in date time control in external list in sharepoint 2010

    How to make users to select the date from calendar control only, by my making the date text field read only (don't want to let users type the date) in date time control in external list in sharepoint 2010. I am looking for a solution which can
    be done through sharepoint desginer / out of the box.
    thanks.

    Congratulate you got the solution by yourself. I am new to a
    WinForms calendar component, I feel so helpless on many problems even I'd read many tutorials. This question on the
    calendar date selection did me a great favor. Cheers.

  • OA Framework,how to make field Read-Only which is used inside Switch case

    Hi all,
    Using Personalization in OA Framework, when I am trying to make field read only, which is inside Swich statement ,then that field get automatically hidden.but my purpose is to make that field read-only not hide.
    My field name is Proposed Annual Increase Amount .
    The Personalization swtich case lookslike this :-
    Field Name Shown
    Switcher: Proposed Annual Increase Amount Yes
    case_name_HrPRateAnnTotInputSs
    Message Text Input: New Annual Amount Yes
    case_name_HrPRateAnnInputSs
    Message Text Input: Annual Pay Rate Yes
    case_name_HrPRateCurrAnnSalSs
    Message Styled Text: Pay Rate
    Regards,
    Mxj2930

    Can you be a bit clear on your requirement. If you have a switcher to display a field based on some condition, the other fields will not get displayed. I did not get as to what you mean by "my purpose is to make that field read-only not hide.".
    Are you talking about the case, when the "New Annual Amount" (or) "Annual Pay Rate" fields are displayed conditionally, you want them to be read-only and not editable. If this is the case, set the read-only property of these fields to true.

  • How to make fields read-only

    While I may allow a customer to see their billing address, I don't want them to change it.  How can I make certain fields read-only?

    Hi Thomas,
    If you are using 2007, find the ~/common/controls/accountaddressblock.ascx and make the templatefields that hold the delete button and the edit button invisible.
    <asp:TemplateField Visible="false">
    You will probably also want to make the add button invisible.
    If you are on 5.9, this may not work.  I think the address block is also used in the admin area.

  • Clear form Option resets read only properties

    Hey guys,
                         Using your help I got my problem solved last time. So when I have a series of Questions, I set all questions to read only in their properties except the first Question. Once the first question is answered, using the script below, I then set read only for the next question to false and students can answer the next question now. So using this pattern, it allows them to answer one question after the other without skipping any.
    The Mouse Up action for each "Radio Button1" could be:
    if(event.value != "Off") this.getField('Radio Button2').readonly = false;
    Now, while this works perfectly for time being, I keep experimenting with this form with lots of modifications made as needed. When I use the "clear form" Option to empty all the form fields before saving it, all the read only Questions reset and now when we close and re open the file, any question can be answered and the script used above has no more value.
    What is the script needed here to avoid the read only questions to reset when i use the clear form option. Please help me out here!

    Clear the form menu action or the "this.resetForm();" script only resets the values of the fields.
    You script will one execute when there is a Mouse Up action, and if a radio button or check box is set to read only then there can be no field actions. The field is locked to user interaction and can only be manipulated by JavaScripts.
    There is no trap for the reset or clear action so even if you created a button to reset and clear the form fields with the read only property set, you would still have the issue of the user using the menu option. You can add a document level script to clear the read only property of fields when the form is opened.

  • Applet Field Read Only

    I've to create several fields on a custom form applet and these fields should be read only in certain conditions based on a value in an other field on the same applet. how can i do it in a simple way?
    Thank you very much

    Hi,
    I would suggest an other solution. You can create a new Field with a calculated Expression. You have to add a BC user property to every field you want to make readonly.The expression of your calculated field should meet your criteria to make the other fields read-only. If your other fields should be read-only, your expression should be true (Y). If your other fields should not be read only, your expression shuld be false (N)
    BC User Property Name: Field Read Only Field: [Field Name]
    BC User Property Value: YourCalculatedField
    I think this solution is better than using toogle Applets. If you have multiple copies of your Applet you have to change every applet if you need to add a new Field.
    Cheers Andreas

  • Make field read only untill value within pciklist is choosen

    Hello,
    I am trying to establish if it is possible to make a field read-only until a value within a pick list is chosen. Basically we have a pick list called structure and if the field value called "Aligned" is selected then I want the text field called Aligned Name to be available for import all other times this field should not be available.
    Has anyone done anything similar? I'm guessing that this could only be achieved through WF but I haven't been able to find any code to make fields read only.

    For those of you unable to download the document from MetaLink3 here it is:
    As an example to illustrate this requirement, let’s say that once there is a checkbox field called "My_Check_Box". When this field is checked, the "Account Type" field need to become a required for entry by the user. To do this follow these steps:
    1. In the Admin> Application Customization, select the appropriate Object and go into the Object Field Setup.
    2. Edit the field called "My_Check_Box" and enter a Field Validation expression so it uses the following expression:
    =[<bMy_Check_Box_ITAG>] AND NOT([<AccountType>] IS NULL AND [<bMy_Check_Box_ITAG >]='Y')
    3. Enter an explicit error message.
    This expression means that when the checkbox field is checked, the Account Type becomes required. Your custom error message will be raised when checking the checkbox, leaving the account type unpopulated and trying to save the account record.
    4. Edit the Account Type field and enter the following expression as Field Validation:
    =[<AccountType>] AND NOT([<AccountType>] IS NULL AND [<bMy_Check_Box_ITAG >]='Y')
    5. Enter an explicit error message.
    That validation handles the user case where a user changes the Account Type value from a NOT NULL value to a NULL value. Your custom error message will be raised when emptying out the account type from a populated value to nothing while the checkbox is checked and trying to save the account record.
    Note that the expression in both fields validations begins with the field variable on which the statement is being written.**

  • Make "File name" and "Files of type" fields read-only in JFileChooser

    I try to make the "File name" and "Files of type" fields read-only in JFileChooser dialog. Anybody
    knows how to do? Thanks.

    You mean so the user can't choose the name of the file to open or save? Not much point in even using a JFileChooser, then, is there? Or did I misunderstand the question?

Maybe you are looking for

  • ITunes store not loading with iOS 7 on iPhone 4S

    iTunes store not loading with iOS 7 on iPhone 4S. I have tried reset network connections I have restored I have backuped I have erased all content I have rebooted I have DFUed. I have also the same issue with iTunes on pc, with -50 error. Is this an

  • Unable to enable SPDIF??? X-Fi XtremeGamer (non-PRO) w/ Digital I/O Module

    JUnable to enable SPDIF? X-Fi XtremeGamer (non-PRO) w/ Digital I/O Module? I recently purchased the Digital I/O module in order to use SPDIF Out on my X-Fi XtremeGamer in order to send audio to my 5. receiver via digital coax. However after hooking u

  • Problem with instalation JMF

    Hi, I have installed JMF in Ubuntu 9.04, but when I execute JMStudy I have the next error: javi@rabocop2:~$ java JMFStudio Exception in thread "main" java.lang.NoClassDefFoundError: JMFStudio Caused by: java.lang.ClassNotFoundException: JMFStudio    

  • Type Casting and Truncating

    I need to have the use input a double amount such as 11.56 and then output the number of dollar bills and coins; such as the nubmer of quarters, dimes, nickles and pennies. I was able to get as far as outputting to console the dollars, but how do I g

  • Illustrator crash, recovered file not most recent

    Hi Over the past two days, Illustrator CC v17.1 has crashed for no obvious reason. In each case, I have been working and saving my files regularly. However, when I relaunch Illustrator and open my file, it displays an older version, not the latest. I