How to display custom field of type radio?

  • Patrick
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 1 month ago - 4 years 1 month ago #132884 by Patrick
Hello

I use custom field of type radio fpr front end submision:
Code:
<field name="field_waehrung" label="EB_FIELD_WAEHRUNG" type="select" default="CHF" required="true" class="eb-extrafield eb-dropdown validate[required]"> <option value="CHF">CHF</option> <option value="EUR">EUR</option></field>

How can I display this field in form for frontend submission?

In Override of theme file /event/simple.php I have added
Code:
<?php if ($this->config->event_custom_field) { foreach ($this->form->getFieldset('basic') as $field) { ?> <?php if($field->fieldname == "field_waehrung") : ?> <?php echo $field->select; ?> <?php endif; ?> <?php } } ?>

But it is not working. Using
Code:
<?php echo $field->input; ?>

gives textfield and not radio buttons.

How can I display radio buttons?

Thanks.

Patrick
Last edit: 4 years 1 month ago by Patrick.

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

More
4 years 1 month ago #132892 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to display custom field of type radio?
Hello

You do not have to customize the code at all. Just define the field properly, see documentation at docs.joomla.org/Standard_form_field_types

There is no select field type as you defined. If you want to have radio field, define a radio custom field type docs.joomla.org/Special:MyLanguage/Radio_form_field_type

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 1 month ago #132928 by Patrick
Replied by Patrick on topic How to display custom field of type radio?
Hi Tuan

Works, thanks.

Patrick

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

More
4 years 1 month ago #132932 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to display custom field of type radio?
Great. Thanks for confirming

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

Moderators: Tuan Pham Ngoc