This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

trademark

  • **
  • 5 posts
Default value for select box fields
« on: December 01, 2021, 01:25:47 PM »
Hello,

I noticed that the SelectBox custom field doesn't have a default option value like "Select field". If the field is not mandatory the user is forced to select a value or leave the first value which is preselected.

This feature is available in the filters section where the "Select field" value is default. How can I have the same on the Post Ad form?
I have added images to help clarify.

Thanks!

*

MB Themes

Re: Default value for select box fields
« Reply #1 on: December 01, 2021, 03:56:01 PM »
@trademark
If select box is required, what is reason to have there "select value" option?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

trademark

  • **
  • 5 posts
Re: Default value for select box fields
« Reply #2 on: December 01, 2021, 05:52:53 PM »
@trademark
If select box is required, what is reason to have there "select value" option?


The same behavior happens if the field is not required.

*

MB Themes

Re: Default value for select box fields
« Reply #3 on: December 01, 2021, 07:42:51 PM »
Oki, let me check that  ::)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Marked as best answer by frosticek on December 19, 2021, 03:17:00 PM
*

MB Themes

Re: Default value for select box fields
« Reply #4 on: December 02, 2021, 07:47:50 AM »
You can update it in oc-includes/osclass/frm/Field.form.class.php

Find:
Code: [Select]
            if($search ) {
              echo '<option value="">'. __('Select', 'osclass')." ". $field['s_name'].'</option>';
            }

Replace with:
Code: [Select]

            echo '<option value="">'. __('Select', 'osclass')." ". $field['s_name'].'</option>';
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

trademark

  • **
  • 5 posts
Re: Default value for select box fields
« Reply #5 on: December 19, 2021, 12:54:11 PM »
That worked, Thank you!