Problems, need help? Have a tip or advice? Post it here.
10 posts Page 1 of 1
Hello Couchers / KK,
I am using the extended users functionality. What I am trying to do is to find a way to go through a user's cloned page to check if any of the fields is empty so I can prompt the user to set up those fields. All of this will be done at the front-end. Is there a way to do this instead of having to check each field to see if any of them is empty (I can't use this approach because I have added a lot of editable fields to k_user_template).

I though I could use db_fields but realised I am unable to.
Code: Select all
<cms:db_fields masterpage=k_user_template id=k_user_id >
..........
</cms:db_fields>


Thank you
Hi,

If the 'required' parameter of an editable region is set to '1', Couch will automatically check if a field has been left empty and output a prompt. Any reason why this is not sufficient for your use-case?
Hi KK,
Any reason why this is not sufficient for your use-case?

I am unsure if it will work for my use-case because of this reason:
When a user first registers on the website they are not required to fill in fields like Address, Contact number and other infos. The only fields on the signup page are Email, Password, Password repeat (To allow for a faster registration). So what I want to do is to only prompt them to do so after they activate their account and finally login. I hope I explained myself better now. Thank you
Upon successful login, redirect user to the profile page, where the form has all the 'required' inputs.
Hi trendoman,
I have no problem at all redirecting users to their profile page. Lets say a user is on a different page other than their profile page, I want to be able to show a notice somewhere at the top of the page that their profile details in not complete. I can show that notice by using an if statement and empty tag to check the fields one by one but that will be a lot of considering the fact that the editable fields are over 15. I hope you get me :lol:
Add a chekbox with opt_values='Complete = 1' and set it to 1 only when all fields are not empty. It being not 1 allows to show the notice without actually checking fields.
Great solution trendoman. Thank you very much.
So that will mean that when a user sees the prompt they will be forced to go to the profile page to complete it. After which I will use DBF to change the Complete status to 1.

However that can only be possible if the user has truly filled all the fields and that will mean that I still will need to check each field to make sure they are not empty and that brings me back to the very problem I am trying to find a way around. :D
#1 A DBF form with bound inputs on the Profile page + required parameter in editables' definition. OR
#2 A regular Couch-managed form (non-dbf) with non-bound inputs, each with 'requried' parameter.

Checkbox 'complete', of course, is not set as 'required'. It is not visble in the form. Here we rely on Couch to do the dirty work and expect to place our code that changes the checkbox to '1' inside the k_success block of the form. As you could expect, k_success is triggered only after required fields are filled and validated.
Ok ok I now get your point. With your solution, once the user visits the profile page, they should be forced to fill the form using required fields.

I will go with your solution. Thank you very much :D
adimpressions wrote: Ok ok I now get your point. With your solution, once the user visits the profile page, they should be forced to fill the form using required fields.

I will go with your solution. Thank you very much :D

You are welcome!
User can avoid to submit the form, though. There is no way to force user fill the form. That is the other, perhaps minor, issue.
10 posts Page 1 of 1