How to display custom field of type radio?

  • Patrick
  • Patrick's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
2 weeks 5 days ago - 2 weeks 5 days ago #132884 by Patrick
Hello

I use custom field of type radio fpr front end submision:
<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
	<?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
<?php echo $field->input; ?>

gives textfield and not radio buttons.

How can I display radio buttons?

Thanks.

Patrick
Last edit: 2 weeks 5 days ago by Patrick.

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

More
2 weeks 5 days 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
  • Patrick's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
2 weeks 3 days 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
2 weeks 3 days 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