10 years ago
Topic

Hi!

I am wondering if there is a way to set different messages for the same form, when the frorm is submitted.

I have a custom registration form that I am using for editing profile as well. 

When someone registers, I set a message like: thank you for your registration, please check your email and activate your account. 

But when someone logs in and make changes to the account I am getting the same message. I would like to change it when the user is logged in. 
First I thought about the custom file that I set when I do not have access to the content when doing a search, but that option is only at the search type forms.
Any suggestions?

Thanks!

Get a Book for SEBLOD
10 years ago
1
Level 1

Hi Milli05! 

Have you tried to create two different forms? One for registration and one for registered users?

Rgds.

Elisa

10 years ago
0
Level 2

Hi designbengel! 

Unfortunately I do not know how to set as a different form for joomla to use that for editing profile. 
As I noticed, it uses the one used for registration. 

175 Posts
webcastor
10 years ago
1
Level 1

Hello Éva!

You have stumbled upon a really nice challenge there :)

I looked at it, and what I found is that the message must be generated during one of before-store/after-store stages. So, unless you are willing to try injecting another message via Code Pack (30€), you might eventually try something in /layouts/joomla/system/message.php where the message is generated, for example test if the user is logged in, and if not, than probably is submitting a new registration so you can "inject" your new reg. message, or else the edited reg message. On a side note, the message does obey the JText conversion, if that brings any ideas.

My suggestion would be to create 2 Free Text message fields with your messages above the Submit button, and by using Conditional States (Site Form | display mode #5) you can display one message or the other based on if user_id Is Empty condition. Naturally, user_id must be present in the form, but you can put it into HIDDEN position or hide it otherwise.

10 years ago
0
Level 2

Thank you Webcastor!

I just modified my message so that it will be ok for both case.

Get a VIP membership