You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
errors on the line below added just below email. Throws error Undefined index: phone in /path/to/process.php on line 22 $phone = stripslashes(trim($_POST['phone']));
if (empty($phone)) { $errors['phone'] = $config->get('messages.validation.emptyphone'); }
Thank you, now I just have to integrate it into uikit and I should be set!!! Thank god I am doing a full rewrite of a single pager site that used your older code. So this should be easier. Thanks again
I added a field for phone and it did not work so I tried adding the right(hopefully) code so it could be processed and sent did not work.
index.php
<div class="form-group" id="phone-field"> <label for="form-phone" class="col-lg-2 control-label"><?php echo $config->get('fields.phone'); ?></label> <div class="col-lg-10"> <input type="phone" class="form-control" id="form-phone" name="form-phone" placeholder="<?php echo $config->get('fields.phone'); ?>" required> </div> </div>
contactform.js(sorry for some reason this code is being escaped by github but is showing up correctly)
if (data.errors.phone) {
var email = document.querySelector('input[name="form-phone"]').parentNode,
error;
config.php
'phone' => 'Phone is required',
proccess.php
errors on the line below added just below email. Throws error Undefined index: phone in /path/to/process.php on line 22
$phone = stripslashes(trim($_POST['phone']));
if (empty($phone)) { $errors['phone'] = $config->get('messages.validation.emptyphone'); }
<p><strong>{$config->get('fields.phone')}:</strong> {$phone}</p>
Any help adding a phone field and maybe in the future some type of recapatcha validation would be awesome. Thanks in advance!
The text was updated successfully, but these errors were encountered: