Here’s another one for anyone that might be interested. This allows you to re-create a drop-down menu in a form if you have a custom field of type drop-down.
Instructions are fairly simple :
Version 1.0.1 - Added initial_value_value and initial_value_option parameters
thanks Mark - another doozazzling plugin - might come in handy if I ever figure out how to extend search so that you can pass through a value (eg. song_key) via a dropdown and that the field (eg. song_key) is searched for that value (as well as the usual keywords)
Didn’t think anyone would ever find it although looking at the file above seems it has been downloaded quite a lot! Weird! There must be a lot of silent users in here!!
I’m using this too - it’s really useful, actually. Thank you Mark.
One weird thing that I’ve noticed, though: the dropdown on the front-end side has a blank line between every option value. Those HTML it produces looks like this:
<option value="---">---<option>
<option value="Child Care">Child Care<option>
<option value="Childs Play Center">Childs Play Center<option>
<option value="Day Care & After Sch">Day Care & After Sch<option>
I’m having some problems when setting the “initial_value_option”. I use this plugin in combination with the form helper to create a stand alone edit form were customers can edit their previously entered data.
When I use the following code to display the current value for my field “ploeg”, the correct value is displayed in my page :
{exp:form_helper:field_parser}{ploeg}{/exp:form_helper:field_parser}
Now, when I use the same code to fill in the “inital_value_option” field, the resulting drop down field contains some gibberish value.
If you mean to have the selections already made when outputting the list then no it doesn’t do that and I don’t actually see an easy way of doing that really as all that gets stored in a drop-down list custom field is the names of each option and not whether or not they are selected or not.
Really all my plugin does is finds the options and then spits each one out. To be able to make more than one selected automatically would mean it would need more information that unfortunately isn’t available to it.
I am just trying to create a Drop Down List in my user registration form populated from one of my custom profile fields. I am using a SAEF for member registration.
I have used your plugin and code: but my Drop Down list is showing nothing, not even the initial value ???
My code is here below. Is there something I am missing? My only guess is that it has something to do with being the Member Register form, or should that not mean anything ?? What I also need to ensure is that the selected value is then fed back to the database.
Unfortunately the plugin was created for use with custom weblog fields only and not member profile fields. I’m not entirely certain that a plugin would work in your instance anyway as I don’t believe that the registration form will allow for plugins to be run inside of it. I might be wrong on that one but I know that those templates don’t allow as much to go on as normal weblog templates and so this is why I’ve never really looked at making anything for them I’m afraid.
Gosh that was quick ! It is good to know at least that I can stop heading down this direction I will use your plugin in other ways though ... so that is great.
While I am here, do you know how a member Profile drop down list natively works as a drop down list from the custom profile fields ? I am finding my self populating, by hand, both the custom profile field in EE member temlate and then again in the actual SAEF registration form.???
While I am here, do you know how a member Profile drop down list natively works as a drop down list from the custom profile fields?
That will be some of the core ExpressionEngine code that creates those drop-downs so not too sure where it lives but would definitely be in one of the core files possibly something like the system->modules->member->mod.member.php file or somewhere like that I would imagine.
journalistone - 08 April 2009 04:49 AM
I am finding my self populating, by hand, both the custom profile field in EE member temlate and then again in the actual SAEF registration form.???
Thanks Mark.
Not sure if it will work in the registration form or not but I have very very quickly modified the original plugin to create a new plugin which will only work with custom profile fields instead. Please note that it can only be used for Profile fields and not weblog fields as this was done very quickly.
Pretty much the same code as before but with a slight name change :
{exp:custom_drop_down_profile field_name="profile-drop-down" initial_value_value="my-value" initial_value_option="Choose an option…"} <option value="{value}">{value}</option> {/exp:custom_drop_down_profile}
</select>
Hope it helps a bit. As said before though I know this should work in normal templates that you create in the Templates area but as to using this plugin in the registration templates I’m not so sure of.
I won’t get too excited, and say things like ‘I could kiss you’ - but I just quickly installed the new plugin, and relevant code into the SAEF Registration form… and whamo, It Worked !!!! I submitted a new test registration form and everything went smoothly, right through to the database !!!
I won’t get too excited, and say things like ‘I could kiss you’ - but I just quickly installed the new plugin, and relevant code into the SAEF Registration form… and whamo, It Worked !!!! I submitted a new test registration form and everything went smoothly, right through to the database !!!
THANK YOU MARK ...
Excellent!!
Shows me something too, that plugins can indeed be used in such circumstances so thanks for letting me know