Good day Gurus,
I am using an admin to create UX for my site. I am using one of template to create form wizard and it uses javascript and css to create the submit button. I am not very good in those to but comfortable in PHP and HTML.
I want to capture the form content into the PHP code but it is submitted to javascript code. what to do.
here is the javascript
// Validate steps wizard
// Show form
var form = $(".steps-validation").show();
$(".steps-validation").steps({
headerTag: "h6",
bodyTag: "fieldset",
transitionEffect: "fade",
titleTemplate: '<span class="step">#index#</span> #title#',
labels: {
finish: 'Submit'
},
onStepChanging: function (event, currentIndex, newIndex) {
// Allways allow previous action even if the current form is not valid!
if (currentIndex > newIndex) {
return true;
}
// Forbid next action on "Warning" step if the user is too young
if (newIndex === 3 && Number($("#age-2").val()) < 18) {
return false;
}
// Needed in some cases if the user went back (clean up)
if (currentIndex < newIndex) {
// To remove error styles
form.find(".body:eq(" + newIndex + ") label.error").remove();
form.find(".body:eq(" + newIndex + ") .error").removeClass("error");
}
form.validate().settings.ignore = ":disabled,:hidden";
return form.valid();
},
onFinishing: function (event, currentIndex) {
form.validate().settings.ignore = ":disabled";
return form.valid();
},
onFinished: function (event, currentIndex) {
alert("Submitted!!!");
}
});
// Initialize validation
$(".steps-validation").validate({
ignore: 'input[type=hidden]', // ignore hidden fields
errorClass: 'danger',
successClass: 'success',
highlight: function (element, errorClass) {
$(element).removeClass(errorClass);
},
unhighlight: function (element, errorClass) {
$(element).removeClass(errorClass);
},
errorPlacement: function (error, element) {
error.insertAfter(element);
},
rules: {
email: {
email: true
}
}
});
// Initialize plugins
// ------------------------------
// Date & Time Range
$('.datetime').daterangepicker({
timePicker: true,
timePickerIncrement: 30,
locale: {
format: 'MM/DD/YYYY h:mm A'
}
});
The HTML is here
<form action="#" class="icons-tab-steps wizard-notification">
<!-- Step 1 -->
<h6><i class="step-icon la la-home"></i> Step 1</h6>
<fieldset>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="firstName2">First Name :</label>
<input type="text" class="form-control" id="firstName2">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="lastName2">Last Name :</label>
<input type="text" class="form-control" id="lastName2">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="emailAddress3">Email Address :</label>
<input type="email" class="form-control" id="emailAddress3">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="location2">Select City :</label>
<select class="c-select form-control" id="location2" name="location">
<option value="">Select City</option>
<option value="Amsterdam">Amsterdam</option>
<option value="Berlin">Berlin</option>
<option value="Frankfurt">Frankfurt</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="phoneNumber2">Phone Number :</label>
<input type="tel" class="form-control" id="phoneNumber2">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="date2">Date of Birth :</label>
<input type="date" class="form-control" id="date2">
</div>
</div>
</div>
</fieldset>
<!-- Step 2 -->
<h6><i class="step-icon la la-pencil"></i>Step 2</h6>
<fieldset>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="proposalTitle2">Proposal Title :</label>
<input type="text" class="form-control" id="proposalTitle2">
</div>
<div class="form-group">
<label for="emailAddress4">Email Address :</label>
<input type="email" class="form-control" id="emailAddress4">
</div>
<div class="form-group">
<label for="videoUrl2">Video URL :</label>
<input type="url" class="form-control" id="videoUrl2">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="jobTitle2">Job Title :</label>
<input type="text" class="form-control" id="jobTitle2">
</div>
<div class="form-group">
<label for="shortDescription2">Short Description :</label>
<textarea name="shortDescription" id="shortDescription2" rows="4" class="form-control"></textarea>
</div>
</div>
</div>
</fieldset>
</form>