Page 1 of 1

read only form with edit button

Posted: Sun Feb 09, 2014 8:16 pm
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

Posted: Mon Feb 10, 2014 3:45 pm
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 12656 times
Hope this helps,
Max

Re: read only form with edit button

Posted: Thu Apr 16, 2015 2:05 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

Posted: Wed Dec 20, 2017 5:13 pm
by admin
.