By werushka on
is there a way to hack so the first Selection Option is empty and force user to select....I have searched for a while and cant get any solution other than using content profile which I really don't need
I would really appreciate some feedback.
Thanks
Comments
I'm wondering about this,
I'm wondering about this, too. This is very common in drop-down box selections--it starts out blank & the user must actually select a value before proceeding, not just accept the given value.
This thread has a bit more
This thread has a bit more about it: http://drupal.org/node/41846
The problem was that 'required field' was coming in with "--" as the initial selection, and then accepting that as the response if the user didn't change that initial selection.
So they got working it over in that thread and decided, well it's not OK to allow "--" as the response, so we'll just **remove it** from the list of responses if a response is required.
Problem is, that if you are requiring a response you want users to actually MAKE A RESPONSE, not just lazily accept the first/default response whether that is "--" or something else.
In my case the best solution for now seems to be to uncheck 'response required' for this field. If people don't make a choice I'd rather at least know that!
And in the long run they need to add the "--" option back in but if the user accepts that option that counts as **no response** and they are kicked back to the form to give a response.
Here is the snippet of code
Here is the snippet of code that will fix the problem.
You also need to know that you can now enter "--" as the first entry and leaving that entry selected is considered a non-answer.
In the file 'profile.module' (which will be in your modules directory under 'profile', find the "profile_validate_profile" function and replace it with this:
not works for me and...
I work with laste release of drupal 6.17. The last snippet not works for me and I've found that at line 395 of 'profile.module' the code says:
is this ok? Seems that this code, if the field is required, try to append an array with the '--' value, but then I think that it would be:
not? I've changed the line but the snippet not working for any of the two ways.
Debugging the code, i've seen too that the the code into the while snippet never runs, seems that have a problem with the fields in a category.