How get event custom field name if submitting event in frontend

  • Patrick
  • Patrick's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
3 days 5 hours 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:
<?php
    if ($this->config->event_custom_field)
    {
        foreach ($this->form->getFieldset('basic') as $field)
        {

after I want to add:
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
3 days 5 hours 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
  • Patrick's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
3 days 4 hours ago #130229 by Patrick
Hi Tuan

Works great.

Thanks a lot.

Patrick

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

More
2 days 17 hours 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