PHP - Añadir al formulario de contacto "Su mensaje ha sido enviado correctamente"

 
Vista:

Añadir al formulario de contacto "Su mensaje ha sido enviado correctamente"

Publicado por Somio88 (1 intervención) el 05/06/2020 11:02:13
Buenos días,

Soy un poco novato en esto, y estaba tratando de corregir mi formulario de contacto de la web. Me gustaría saber como podría añadir un mensaje de respuesta (tipo: Su mensaje ha sido enviado correctamente) a mi formulario.

Pues en la actualidad, al enviarlo aparecen una formas geométricas cargando, que pueden hacer al usuario dudar de si se ha enviado o no el mensaje (el mensaje sí que me llega).

Si alguien me puede ayudar se lo agradecería, mi código en el archivo .php en la actualidad es el siguiente:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
if(!class_exists("lawyerpro_consultation")){
	class lawyerpro_consultation{
		function __construct(){
			add_action("init",array($this,"lawyerpro_consultation_init"));
			add_shortcode('lawyerpro_consultation',array($this,'lawyerpro_consultation_shortcode'));
		}
 
		function lawyerpro_consultation_init(){
			if(function_exists("vc_map")){
				vc_map( array(
					'base' => 'lawyerpro_consultation',
					"name" => __( "Consultation Form", "js_composer" ),
					"class" => "lawyerpro_consultation_form_class",
					"icon" => "lawyerpro_consultation_form",
					"params" => array(
 
						array(
							'type' => 'textfield',
							"holder" => "h3",
							'heading' => __( 'Form Title', 'js_composer' ),
							'param_name' => 'form_title_cc',
							'value' => '',
							'description' => __( 'Enter Title For Consultation Form', 'js_composer' )
						),
 
 
						array(
							'type' => 'textfield',
							"holder" => "h3",
							'heading' => __( 'Introduction Excerpt', 'js_composer' ),
							'param_name' => 'intro_excerpt_cc',
							'value' => '',
							'description' => __( 'Add Description Below The Title ', 'js_composer' )
						),
 
 
						array(
							"type" => "textfield",
							"heading" => __( "Enter  Email Address", "js_composer" ),
							"param_name" => "email_cc_admin",
							"value" => '',
							"description" => __( "Email Will Be Used To Send Emails Submitted Through Consultation Form", "js_composer" )
						),
 
					)
				) );
			}
		}
 
		function lawyerpro_consultation_shortcode( $atts, $content = null ) {
 
			$form_title_cc = '';
			$intro_excerpt_cc = '';
			$email_cc_admin = '';
 
 
			extract($atts);
 
			global $wpdb,$post;
 
			$options['practice'] = 'Not Selected';
 
			/* Consultation Form */
 
			$output = '
					<section class="cp-consultation padding-tb-60 cp-consultation-section">
						<div class="cp-heading-1">
							<h2><span>'.$form_title_cc.'</span></h2>
							  <em>'.$intro_excerpt_cc.'</em>
						</div>
						<div id="loader"></div>
						<form method="post" id="consulation_submit">
						<input type="hidden" id="email_cc_admin" name="email_cc_admin" value="'.$email_cc_admin.'">
						  <div class="row">
							<div class="col-md-4">
							  <input type="text" id="name_cc" name="name" placeholder="'.esc_html__('Nombre y apellidos','lawyerpro').' *" required pattern="[a-zA-Z ]+">
							</div>
							<div class="col-md-4">
							  <input type="text" id="email_cc" name="email" placeholder="'.esc_html__('Email','lawyerpro').' *" required pattern="^[a-zA-Z0-9-\_.]+@[a-zA-Z0-9-\_.]+\.[a-zA-Z0-9.]{2,5}$">
							</div>
							<div class="col-md-4">
							  <input type="text" id="phone_cc" name="phone" placeholder="'.esc_html__('Teléfono','lawyerpro').' *" required pattern="(\+?\d[- .]*){7,13}">
							</div>
							<div class="col-md-12">
							  <textarea name="comments" id="message_cc" placeholder="'.esc_html__('Su Mensaje','lawyerpro').' *" rows="10" cols="10" required></textarea>
							</div>
							<div class="input-field" style="margin-left: 3%;">
                                                    <input type="checkbox" required class="filled-in form-check-input" id="privacidad" name="privacidad" >
                                                    <label class="form-check-label" for="privacidad" style="font-size: 15px;">
                                                      He leído y Acepto la <a href="/politica-de-privacidad/" rel="nofollow">Política de Privacidad</a>
                                                    </label>
                                                  </div>
							<div class="col-md-12">
							  <button type="submit">'.esc_html__('Enviar Consulta','lawyerpro').'</button>
							</div>
						  </div>
						</form>
					</section>';
			/* Consultation Form Ends */
 
			return $output;
		}
	}
	new lawyerpro_consultation;
	if(class_exists('WPBakeryShortCode'))
	{
		class WPBakeryShortCode_lawyerpro_consultation extends WPBakeryShortCode {
		}
	}
}
 
?>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder