[[FormIt? hooks=`email` &emailTpl=`emailTpl` &emailFrom=`[[+email]]` &emailTo=`[[++email_contact]]` &emailSubject=`New Contact` &emailUseFieldForSubject=`1` &store=`1` &validate=`name:required, email:email:required` ]]
<?php echo $_POST['name'] ."<br />"; echo $_POST['email'] ."<br />"; echo "==============================<br />"; echo "All Data Submitted Successfully!";
[[!formSubmitNoReload]]
<form role="form" id="form-contact" method="post"> <input type="text" id="name" name="name"> <input type="email" id="email" name="email"> <button type="submit" id="submitFormData" onclick="SubmitFormData();" value="Submit">Send</button> </form>
function SubmitFormData() { var name = $("#name").val(); var email = $("#email").val(); $.post("http://www.mywebsite.com/index.php?id=5", { name: name, email: email }, function(data) { $('#results').html(data); $('#form-contact')[0].reset(); }); }
var formData = { 'name' : $('input[name=name]').val(), 'email' : $('input[name=email]').val(), }; $.post("http://www.mywebsite.com/index.php?id=5", function(formData) { // place success code here }) .fail(function(data) { // place error code here });
function SubmitFormData() { var formData = { 'name' : $('input[name=name]').val(), 'email' : $('input[name=email]').val(), }; $.post("http://www.mywebsite.com/index.php?id=5", function(formData) { $( "#results" ).text( "SUCCESS" ); // place success code here }) .fail(function(data) { $( "#results" ).text( "FAILURE" ); // place error code here }); };
[[FormIt? hooks=`email` &emailTpl=`emailTpl` &emailFrom=`[[+email]]` &emailTo=`[[++email_contact]]` &emailSubject=`New Subscription` &validationErrorMessage=`Please correct the following errors:<br />[[+errors]]<br /><br />` &validate=`name:required, email:email:required` ]]
[[!AjaxForm? &form=`contactFormAJAX` &snippet=`FormIt` &hooks=`email,contactFormSuccess` &emailTpl=`emailTpl` &emailFrom=`[[+email]]` &emailTo=`[[++email_contact]]` &emailSubject=`New Contact` &validationErrorMessage=`Please correct the following errors:<br />[[+errors]]<br /><br />` &vTextRequired=`Required` &validate=`name:required, email:email:required` ]]
<?php $modx->setPlaceholder('fi.custom.success','Hi, thank you.'); return true;
[[!AjaxForm? &snippet=`FormIt` &form=`tplAjaxForm` &hooks=`email` &emailSubject=`New Contact` &emailFrom=`[[+email]]` &emailTo=`[[++email_contact]]` &emailTpl=`emailTpl` &validate=`name:required,email:email:required` &validationErrorMessage=`Please correct the following errors:[[+errors]]` &successMessage=`Cool, thanks` ]]
<form id="contact-form" action="" method="post" class="ajax_form af_example"> <fieldset class="form-group"><!-- Name --> <label for="name" class="contact-label"> [[%af_label_name]] [[!+fi.error.name]] </label> <input type="text" id="af_name" name="name" class="form-control" placeholder="" value="[[!+fi.name]]" /> </fieldset> <fieldset class="form-group"><!-- Email --> <label for="email" class="contact-label"> [[%af_label_email]] [[!+fi.error.email]] </label> <input type="email" id="af_email" name="email" class="form-control" placeholder="" value="[[!+fi.email]]" /> </fieldset> <div class="form-group"> <div class="form-group-margin"> <input type="submit" class="btn-submit" value="[[%af_submit]]" /> </div> </div> [[+fi.success:is=`1`:then=` <div class="alert alert-success">[[+fi.successMessage]]</div> `]] [[+fi.validation_error:is=`1`:then=` <div class="alert alert-danger">[[+fi.validation_error_message]]</div> `]] </form>
Uncaught TypeError: e(...).size is not a functione.jGrowl @ jquery.jgrowl.min.js:1AjaxForm.Message.success @ default.js:101$.ajaxSubmit.success @ default.js:64t.success @ jquery.form.min.js:7i @ jquery.min.js:2j.fireWith @ jquery.min.js:2A @ jquery.min.js:4(anonymous function) @ jquery.min.js:4