MyBB Community Forums
[General] "Select" Custom Fields - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html)
+------ Thread: [General] "Select" Custom Fields (/thread-89093.html)



"Select" Custom Fields - leroy - 2011-02-25

I'm using the latest version of myBB. When setting mandatory custom select fields on registration, the field always defaults to the first value. Is there a way to put a blank value at the top of the list, to force the user to make a choice? I've tried a blank line, a space and &nbsp in the list, but when saving the list, it removes the blank line and the space. &nbsp just shows up as '&nbsp' in the list.


RE: "Select" Custom Fields - Matt - 2011-02-25

I think this'll need a small code edit... in ./member.php, line 541:

foreach($expoptions as $key => $val)

Before this, add:

$select .= "<option value=\"\"></option>";



RE: "Select" Custom Fields - leroy - 2011-02-25

(2011-02-25, 09:24 AM)MattRogowski Wrote: I think this'll need a small code edit... in ./member.php, line 541:

foreach($expoptions as $key => $val)

Before this, add:

$select .= "<option value=\"\"></option>";

I'll give it a go, thanks for your response Smile


(2011-02-25, 10:00 AM)leroy Wrote:
(2011-02-25, 09:24 AM)MattRogowski Wrote: I think this'll need a small code edit... in ./member.php, line 541:

foreach($expoptions as $key => $val)

Before this, add:

$select .= "<option value=\"\"></option>";

I'll give it a go, thanks for your response Smile

That worked fine. I also added 'selected' to this option, so that it didn't highlight the first one in the list but highlighted the blank one. Thanks again.



RE: "Select" Custom Fields - armin3000 - 2012-06-10

I didn't understand what exactly you did?!!
I want to have a default blank choice for optional custom fields in registration page that can be leaved blank and a default blank item in mandatory fields that users should change it. I added the mentioned code modification in member.php (Using 1.6.8) but it still removes first blank line item and selects first item as default.
would you please explain more


RE: "Select" Custom Fields - MR.SASHA - 2014-11-15

(2012-06-10, 10:45 PM)armin3000 Wrote: I didn't understand what exactly you did?!!
I want to have a default blank choice for optional custom fields in registration page that can be leaved blank and a default blank item in mandatory fields that users should change it. I added the mentioned code modification in member.php (Using 1.6.8) but it still removes first blank line item and selects first item as default.
would you please explain more

Me and my friend had the same problem
Please help


RE: "Select" Custom Fields - MR.SASHA - 2014-11-17

up......


RE: "Select" Custom Fields - MR.SASHA - 2014-11-19

up.... please help


RE: "Select" Custom Fields - MR.SASHA - 2014-11-24

up.........


RE: "Select" Custom Fields - MR.SASHA - 2014-11-25

up.............