read only form with edit button

read only form with edit button

Postby barrydocks » Mon Feb 10, 2014 4:46 am

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
barrydocks
 
Posts: 18
Joined: Thu Dec 19, 2013 1:14 am

Re: read only form with edit button

Postby massiws » Tue Feb 11, 2014 12:15 am

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 4307 times


Hope this helps,
Max
massiws
 
Posts: 503
Joined: Thu May 24, 2012 9:38 am
Location: Milan, Italy

Re: read only form with edit button

Postby Tinka » Thu Apr 16, 2015 9:35 pm

Hi

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

BR, Tinka
Tinka
 
Posts: 66
Joined: Mon Feb 24, 2014 11:28 pm

Re: read only form with edit button

Postby sysysy » Tue Oct 10, 2017 3:09 pm

that s a very good post by you...well done
Graduated from Soran University with First Class Degree with Honours in Computer Science
sysysy
 
Posts: 2
Joined: Tue Sep 19, 2017 5:23 pm

Re: read only form with edit button

Postby admin » Thu Dec 21, 2017 1:43 am

.
admin
Site Admin
 
Posts: 2053
Joined: Mon Jun 15, 2009 9:53 am


Return to General