Support

Home Forums Event Espresso Premium Default value for a custom field

Default value for a custom field

Posted: February 19, 2018 at 11:27 am

Viewing 2 reply threads


jacl

February 19, 2018 at 11:27 am

Hi I’ve added frontned reg form validation and conditional fields using java script and all works well..

Do you have any examples of how to run javascript in backend on certion espresso admin pages such as when adding a new registration…. then perhaps I can get the same script that sets values on fields based on others working in backend too.

Or any way to give a field a default value?


Tony

  • Support Staff

February 21, 2018 at 4:20 am

Hi there,

There’s actually a filter that allows you to set the default value – FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__input_constructor_args

An example of using that filter to set a default value on the primary registrant using user_meta is here:

https://gist.github.com/Pebblo/0abe11d85af126e0aa0db80b1772901b

Although, another option to add your JS into the admin is to use wp_add_inline_script() and hook your script into ee-spco-for-admin meaning your custom JS will be output whenever ee-spco-for-admin is enqueued.


jacl

February 22, 2018 at 6:56 am

Thanks so much Tony 🙂

Viewing 2 reply threads

The support post ‘Default value for a custom field’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso