How get event custom field name if submitting event in frontend

  • Patrick
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 4 months ago #130227 by Patrick
Hello

In frontend submission I want to add a subtitle between event custom fields.

I use this override: /templates/mytemplate/html/com_eventbooking/event/simple.php

There I see this code:
Code:
<?php if ($this->config->event_custom_field) { foreach ($this->form->getFieldset('basic') as $field) {

after I want to add:
Code:
if($field->name == "field_name_mytestfield") { echo "Hello test"; }


But this is not working.

What would be working code?

Thanks.

Patrick

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #130228 by Tuan Pham Ngoc
Try to change if($field->name == "field_name_mytestfield")

to if($field->fieldname== "field_name_mytestfield")

To see if it solves the issue?

Tuan
The following user(s) said Thank You: Patrick

Please Log in or Create an account to join the conversation.

  • Patrick
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 4 months ago #130229 by Patrick
Hi Tuan

Works great.

Thanks a lot.

Patrick

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #130243 by Tuan Pham Ngoc
Great. Thanks for confirming

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc