Contact Form doesn't work

1 reply · opened Apr 20, 2018

FfunkynickApr 20, 2018

Hello, dear support.
I have some problems with my contact form.

I have this error, when i try to click "Submit":

{ "alert": "error", "message": "Please Fill up all the Fields and Try Again." }

I don't change anything in sendemail.php, i only change $toemails array

<form class="nobottommargin ast-contact-form" id="template-contactform" name="template-contactform" action="include/sendemail.php" method="post">

						<div class="row clearfix">
								<div class="col-lg-9 divcenter center sect7cont">
										<div class="form-process"></div>
										<div class="col_one_third">
											<input type="text" id="template-contactform-name" name="template-contactform-name" value="" class="sm-form-control required ast-cf-input" placeholder="Имя" />
										</div>
										<div class="col_one_third">
											<input type="text" id="template-contactform-phone" name="template-contactform-phone" value="" class="sm-form-control required ast-cf-input" placeholder="Телефон"  />
										</div>
										<div class="col_one_third col_last">
											<textarea class="required sm-form-control ast-cf-input" id="template-contactform-message" name="template-contactform-message" rows="1" cols="30" placeholder="Ваш вопрос" ></textarea>
										</div>
								</div>

								<div class="col_full hidden">
									<input type="text" id="template-contactform-botcheck" name="template-contactform-botcheck" value="" class="sm-form-control" />
								</div>

								<div class="col-lg-12 divcenter center sect7cont">
									<div class="sect5btn">
										<button type="submit" id="template-contactform-submit" name="template-contactform-submit" value="submit">Записаться</button>
									</div>
								</div>
						</div>
					</form>

What problem can it be?
Thanks for your help.

SSemicolon WebSTAFFMay 2, 2018

Hello,

Upon checking the HTML of your Form, we can see that there is no Email Field setup for your Contact Form which is why you are receiving this error. Please set up an Email Field or simply remove the if( $_POST['template-contactform-email'] != '' ) Statement in the include/sendemail.php File and move its content outside the if/else block. Then change the following code:

$email = isset( $_POST['template-contactform-email'] ) ? $_POST['template-contactform-email'] : '';

to:

$email = 'user@email.com';

This should definitely fix the issue. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard