protected fields

prophoto

Active Member
How do I allow a user to submit content in a field but prevent them from editing it later on? I've looked at the element permissions but don't see an option.
 
Hi
For this you will need to update from github - as I have added it today.
Once updated you can edit the element and select a view level higher than the user accessing the form for the "access->form (edit) " option.
This will make the element appear as read-only text on the form.
If you don't want it to appear at all set the "access->details" option to the same view level as the "form(edit)" option

-Rob
 
Will do. One more question along the same lines, I want to show a message like "you must login to view this data" for certain fields? I want to protect some fields from public view but allow them for registered users.

Example guest view:

Business Name: Joe Blow Business
Phone: Login or Register to View
Email: Login or Register to View
Website: joeblowbusiness.biz

Example registered view:

Business Name: Joe Blow Business
Phone: 212-555-1212
Email: joe@joeblowbusiness.biz
Website: joeblowbusiness.biz
 
Thats going to be tricky to do.
With the acl you have either the choice to:

* not show the label and field/read only data
* show the label and field.

Just by using Fabrik's options there's no distinction made so that you can show a label and replace the read only content with a custom message.

The simplest solution would be to use some js (http://fabrikar.com/forums/index.php?wiki/javascript/) to alter the hidden content


JavaScript:
requirejs(['fab/fabrik'], function () {
  Fabrik.getBlock('form_1').elements.each(function(element) {
    if (element.options.editable === false) {
      element.update('<a href="">Login</a> or <a href="">Register</a> to View');
    }
  });
});

replace the 1 in form_1 with your form's id.
Add the correct links the the href's
 
well the wiki page i linked to is the documentation. what specifically do you not understand? Is it where to put the file, the content of the javascript itself?
 
You don't need to install anything
So quoting the relevant parts from the documentation:

Custom javascript files should be located in:
/components/com_fabrik/js
.....
Fabrik 3.1 onwards:
.......

For form views your file should be still be form_X.js where X is the form's id.
So say your form ID is 1 you should have a file in components/com_fabrik/js/form_1.js, with the code I posted previously
 
I think the wiki page Rob linked to is fairly self explanatory. It tells you where to put the file, and what to call it. You just need to replace the X with the numeric ID of your form or list (the number in the left most column of your list of Lists or Forms on the Fabrik backend), depending on whether you are adding JS for a form or a list.

Like Rob, I'm a little confused about what it is the wiki isn't telling you, or what more detailed explanation we can give you.

-- hugh
 
So far this is not working. I've created the file /components/com_fabrik/js/form_2.js and placed in the code. There is no change.

Just to be clear, we want to require people to sign up to see all data, but want to be sure they know the data is there to view. We only want a few of the field values to be hidden in the details view, not all. How would I choose which field entries are redacted in the details view?
 
I'd have to see your site to know why it's not working, but your "My Sites" doesn't seem to be filled out.

Looking at Rob's code, it should track the edit ACL status (Form access) of the element, so if they don't ave edit access, they'll see that msg.

-- hugh
 
I'd have to see your site to know why it's not working, but your "My Sites" doesn't seem to be filled out.
I don't care to make my sites public, but I do appreciate the offer, thanks.

Looking at Rob's code, it should track the edit ACL status (Form access) of the element, so if they don't ave edit access, they'll see that msg.
Is there anything else I need to do to make fabrik recognize that there is js to be loaded? A button somewhere in the list or form? I only want this message to show up for the public, registered users and editors should be able to see it.
 
We really do need access to the site to provide an answer here. You don't need to make the site public. You can set it to be 'offline' in your Joomla global configuration page and then provide us with a login in http://fabrikar.com/you/my-sites/

Is there anything else I need to do to make fabrik recognize that there is js to be loaded?
No there's nothing else you need to do beyond what is in the documentation, we simply check for the file, if its present we load it, and its run automatically.
 
Its not public! Its exactly the same as sending a PM except both Hugh and I can access it, and once the form is fill in we have all the information we would need to help you.
 
Ummm, you posted about the site in another thread why are you still asking for the info? I filled it out already. Getting frustrated!!!!!!!!!!!!!! This should not be difficult!!!!!!!!
 
Yes, it is frustrating. I told you I have to to see your site in order to work on this. Not "it would be helpful", or "it would optionally be useful" to see your site. Have to. You came back and told me thanks, but no thanks, you don't want to give me access, but you still expect me to fix it.

That's like asking a mechanic to fix your car, he says "sure, bring it in, I'll take a look", and you say "no, I don't want you to see the car, but thanks for offering. So, now fix my car".

We're also not mind readers. We don't know that a question you ask on one thread is related to the same site you have another thread open for. May be obvious to you, if you are only working on one site, but most of our Pro users are working on several sites.

So all you had to do was fill in My Sites when I asked you to, and respond on this thread letting me know I now have access.

It's a two way street. You need to help us help you.

I'll take a look now.

-- hugh
 
The username and password you gave in My Sites doesn't work, either on the front or back end.

You also haven't told us which list / form we need to be looking at. Is it the "Featured Guide Listings"?

Note that I will most likely need either ftp details (in your My Sites), or you'll need to have exTplorer installed, so I can edit the form_X.js file. The account you give us will also need to be an admin (super admin, if we use exTplorer for file access).

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top