Page 1 of 1

read only form with edit button

PostPosted: Mon Feb 10, 2014 4:46 am
by barrydocks
I would like to create a read only form with an edit button to allow data changes. My first thought was to create an action button that would load a read/write clone of the original form. Alternatively, I could add an action button that allows a read only form to become a read write form.

Any suggestions on how to accomplish this?

Thanks

Re: read only form with edit button

PostPosted: Tue Feb 11, 2014 12:15 am
by massiws
barrydocs,
there are different ways: it depends on what you need.
barrydocks wrote:My first thought was to create an action button that would load a read/write clone of the original form.

that's what Clone button does (you can also add Display conditions to make it appear only in some cases): the cloned record isn't saved until Save button is pressed. You may want to check your login with Javascript/jQuery in nuBeforeSave() or nuBeforeClone() functions and/or PHP in Custom Code > Before Save.

barrydocks wrote:I could add an action button that allows a read only form to become a read write form.

This could be done in Custom Code > Javascript, for example, add this code in your form to hide Save button:
Code: Select all
function nuLoadThis() {

    //Disable Save button
    $("#nuActionSave").toggle();
   
    // Set all INPUT elements to readonly
    $(":input").attr("readonly","readonly");
   
}

To restore Save button or readonly values you could add a Extra Action button like this:
ExtraActionButton.png
ExtraActionButton.png (12.38 KiB) Viewed 4566 times


Hope this helps,
Max

Re: read only form with edit button

PostPosted: Thu Apr 16, 2015 9:35 pm
by Tinka
Hi

This only makes input fields read-only, but not lookups. Is there an easy way to include these?

BR, Tinka

Re: read only form with edit button

PostPosted: Thu Dec 21, 2017 1:43 am
by admin
.