Support

Home Forums Event Espresso Premium Adding placeholder instead of label

Adding placeholder instead of label

Posted: January 9, 2014 at 5:35 am

Viewing 8 reply threads


Daniele Pavinato

January 9, 2014 at 5:35 am

Hi,

I need to have the form with the placeholder instead of label. Is possible? If yes, how?


Dean

January 9, 2014 at 6:44 am

Hi,

It is possible but you will need to change a function: in event-espresso/includes/functionsform_build.php is a function called event_form_build

It is a large function but is pluggable ( http://codex.wordpress.org/Pluggable_Functions ) so could be copied to a custom plugin or to wp-content/uploads/espresso/custom_functions.php and edited there.

That function will then override the default one.

In the file you can remove the labels and add in the placeholder text as required.

Alternatively you could use a combination of CSS and Javascript to achieve it, by hiding the labels with CSS and using JS to add the placeholders.


Daniele Pavinato

January 9, 2014 at 7:21 am

Understood perfectly!

One more question:

in the custom_functions.php, there must be the check function “function_exists” or can I omit it?


Tony

  • Support Staff

January 9, 2014 at 9:18 am

Hi Daniele,

You want to declare the function within custom_functions.php and then other areas to check if has already been declared and use that (rather than trying to re-declare the function)

So no the check should NOT be included within custom_functions.php. It should not cause an issue if you leave it in however.


Daniele Pavinato

January 9, 2014 at 10:10 am

Thanks very much for the answer.

Last thing about this:

I want to disable the required field “email” in the “Personal informations” group questions.
Is possible?


Sidney Harrell

January 9, 2014 at 10:29 am

It is possible, but not recommended. If you look in the DB with phpMyAdmin, find the table called ‘wp_events_qst_group_rel’, find the row with group_id = 1 and question_id = 3 and delete it.


Daniele Pavinato

January 9, 2014 at 12:18 pm

Is it the only one way to obtain this? If I would like to revert it?


Josh

  • Support Staff

January 9, 2014 at 4:19 pm

Technically you could hide the email field with jQuery and append a dummy email address into the field to leave the database intact.


Daniele Pavinato

January 15, 2014 at 9:52 am

Ok, thank you very much.

Viewing 8 reply threads

The support post ‘Adding placeholder instead of label’ 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