News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

(2.0 RC4) Custom Profile Fields - select box default

Started by hakcenter, January 31, 2011, 08:06:00 PM

Previous topic - Next topic

hakcenter

I noticed that the text style custom field, doesn't show up when you don't have any text in it. Which is great. I would consider that working as intended.

But is there a default for select box / radial that could be considered a opt out / no selection ? I have a tendancy to make a -- select box for no selected value, but it is showing up when people submit their other options for other profile fields.

hakcenter

still looking for some help with this..

select boxes, that aren't a requirement, should have some kind of opt-out / no display like text boxes with no text.

Arantor

Well, I'm not sure this is a bug, exactly so I'm not sure it is going to be 'fixed'. But unfortunately I don't know how to alter it offhand either.
Holder of controversial views, all of which my own.


hakcenter

#3
If we could have a blank menubox item, as the first item...

then the rest.. you could opt out by selecting it.

Because as it stands now, we have a blank box, but when we select it... (after choosing something from before) it still keeps your old selection...

hakcenter

#4
I think the way the 'default value' works is sorta incorrect. Except for a required nature.

We need a bit more language, however.

Profile-Modify.php

Change

$value = $row['default_value'];
to
//$value = $row['default_value'];
$value = '';


Let's users select the blank box again. And it works, but it does make the profile look weird on refresh. If you then go somewhere else, come back to profile view, it shows everything as it should.

Is there an if required check ?

hakcenter

Okay here's a basic fix for the selectbox, allowing users to select the blank box, and it will respect that, as long as the selectbox is not 'required'

Profile-Modify.php

Find
$value = $row['default_value'];
Replace
if ($row['show_reg'] > 1)
$value = $row['default_value'];
else
$value = '';


Joshua Dickerson

Is this relevant? I noticed it on the last page and wasn't tracked.
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

hakcenter

I don't think so ? I think it made it up stream.. Would have to check against my forum but all seems fine

Joshua Dickerson

hakcenter, if you wouldn't mind checking, I would like to close this. Thanks :)
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

hakcenter

Wow I never updated this, lame..

No it is not fixed 2.0.2

Arantor

Previously tracked as https://github.com/SimpleMachines/SMF2.1/issues/1176 - closing this as a duplicate of all the other reports (and this way it's confirmed and will be resolved for 2.1)
Holder of controversial views, all of which my own.


Advertisement: