1. Home
  2. Developer
  3. Code Snippets
  4. Adding text/HTML before or after input in a form

Adding text/HTML before or after input in a form

Sometimes you need to insert text/HTML in the middle of the from between the inputs,

We have a set of actions to help you do that

do_action( 'matador_application_before_field', $field, $args  );

do_action( "matador_application_before_field_type_$type" );

do_action( "matador_application_before_field_template_$template" );

do_action( "matador_application_before_field_name_$field" );

INPUT GOES HERE

do_action( "matador_application_after_field_name_$field" );

do_action( "matador_application_after_field_template_$template" );

do_action( "matador_application_after_field_type_$type" );

do_action( 'matador_application_after_field', $field, $args );

You can use any of the actions as needed. In the example below we are using the
“matador_application_before_field_name_$field action.

The $field in the action name needs to be replaced by the ID of the input in this example case is is “phone”

add_action( 'matador_application_before_field_name_phone', function() {

 echo "this is before the phone";

} );

add_action( 'matador_application_after_field_name_phone', function(){

   echo "this is after the phone";

} );

this will produce this output in the form

You would add this code to your Matador Customization file.

Updated on February 15, 2024
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support