MyBB Community Forums

Full Version: "Select" Custom Fields
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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>";
(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.
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
(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
up......
up.... please help
up.........
up.............