What Are You Doing With the Option Element?

What are you using the Option Element for? Just curious what use cases are involved or ideas you all might have for this element.

Hi, Well I’m trying to use the Option element.

I wanted to create a page to allow users to update a couple of option field values.
Using Pro forms to create the submission, which works but with some issues.

1.) I can’t see how to populate the forms option input field with the existing option field value ( or the fallback value )
2.) I can’t see how to do any checking of the submitted value to ensure valid. e.g. if I leave a field blank currently it resets the option field to be blank ( doesn’t display the fallback value ). Would be better to leave the current value in place ( of course this would be solved if I could get 1) to work. )

So currently I use the Option Elements to display the current option values above the form. Not ideal but works.

Cheers
Alan

Hey Alan! :slight_smile:

Happy to help you here!

  1. You can use something like {echo:get_option('name')} in the “Initial Value” form field control to populate the field with the current option value

  2. This is technically correct. Because if you for example want to store user account data like names or something, the user should be able to empty the fields. A way with a good UX would be to populate initial data there. OR: for some actions, there is an option “Ignore empty fields” what you can set optionally. This would be also doable for “Update Option”. Would that help? :slight_smile:

Wow many thanks for the quick response.

Yes the echo works a treat to populate the content.
I’ll be using this with ACPT options. I’m hoping that I’ll be able to pick the option field from the dynamic icon as ACPT populates the dropdowns. But can’t test this on the Try environment. But Echo is almost as good.

Time to buy.
Many thanks!

1 Like

Update:
Purchased and tried this on a site using ACPT to provide the Custom Post types and option fields.

Good news is that as the ACPT option fields appear in the Bricks dynamic data dropdowns its really simple to select them within the Pro Forms fields. Also any other element such as Option Element. No need for the Echo.

Now have a working form to update my option values and very happy.

Many thanks
Alan

1 Like

Great! Thanks for feedback! :blush: