7 years ago
1
Topic

Hello,

I'm hoping someone can help me. I've searched around but haven't been able to find anything to help me.

I want my "Article Title" field to be filled with the content from two other fields, with a dash between them.

My fields are:

Field 1: Article Title
Field 2: Exam Name (Drop Down, required)
Field 3: Closing Date (Date, required)

When "Exam Name" and "Closing Date" fields are changed, I want Article Title to be updated with the values selected in "Exam Name" and "Closing Date", with dash in between.

Example:

Article Title = Paper1-2016-10-27

Assuming the "Exam Name" field is set to "Paper1" and the Closing date is set to "2016-10-27".

I hope this makes sense. The dash between the two is not actually essential.

Any thoughts?

Thanks in advance!

G

Get a VIP membership
1283 Posts
Bucklash
7 years ago
0
Level 1
Hi

Use BEFORESTORE field to do this.

using-code-pack

There are more tutorials on on this...

$config['storages']['#__content']['title'] = $fields['exam_name']->value . '-' . $fields['closing_date']->value;

 

Or something like that...

Anyway, before or afterstor field is the way to go.

Bucklash

Get a VIP membership