Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Form Post Callback Rate Topic   - - - - -

 
  • natewallis
  • Senior Member
  • Members
  • Join Date: 11-Jan 13
  • 174 posts

Posted 15 June 2015 - 12:40 AM #1

Hi,

I have a form with a name called "quick_contact" and I am trying to execute some javascript when this form submission has completed. It is an AJAX form. However my callback is not triggered, can anyone see any issues? I have using CSCART 4.2.4

<script type="text/javascript">
$(document).ready(function(){
$.ceEvent('on', 'ce.formpost_quick_contact', function(form, elm) {
console.log("post_form event");
if (!e.html && $("#enquiry_type").val() == "Sale"){
console.log("sales enquiry");
ga('send','event','Email Lead',$("#contact_email").val(), $("#contact_name").val());
}
});
});
</script>

Cheers...

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19365 posts

Posted 15 June 2015 - 09:44 AM #2

Please try

<script type="text/javascript" class="cm-ajax-force">

And do not forget to clear cache then

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 

Posted 15 June 2015 - 05:52 PM #3

hi,

Addition of class "cm-ajax-force" should help however if not, please provide temporary FTP access via Personal Messager so our specialists check the issue for you.

best regards,
WSA team

 
  • natewallis
  • Senior Member
  • Members
  • Join Date: 11-Jan 13
  • 174 posts

Posted 16 June 2015 - 01:32 AM #4

Hi there, thanks for that.. still not working, here is my code

<script type="text/javascript" class="cm-ajax-force">
	  $(document).ready(function(){
		$.ceEvent('on', 'ce.formpost_quick_contact', function(form, elm) {
		  console.log("post_form event");
		  if (!e.html && $("#enquiry_type").val() == "Sale"){
			console.log("sales enquiry");
			ga('send','event','Email Lead',$("#contact_email").val(), $("#contact_name").val());
		  }
		});
	  });
	</script>

<div id="quick_contact_container" style="margin-bottom:20px;background:#c6c6c6;padding:20px;" class="bfaCornerRadius">
<h2>Have a question?  You can use the form below to send us a message</h2>
  <form action="http://testing.bar-fridges-australia.com.au/" class="cm-ajax cm-processed-form" method="post" name="quick_contact" enctype="multipart/form-data" target="_self">
	<input type="hidden" name="redirect_url" value="index.php">
	<input type="hidden" name="result_ids" value="quick_contact_captcha">

<div style="float:left;width:50%;">
	<div class="control-group profile-field-wrap shipping-email">
	  <label for="contact_name" class="cm-profile-field cm-required">Name</label>
	  <input type="text" id="contact_name" name="name" size="32" class="input-text cm-skip-avail-switch">
	</div>
	<div class="control-group profile-field-wrap shipping-email">
	  <label for="contact_email" class="cm-profile-field cm-required cm-email">E-mail</label>
	  <input type="text" id="contact_email" name="email" size="32" class="input-text cm-skip-avail-switch">
	</div>
	<div class="control-group profile-field-wrap shipping-email">
	  <label for="contact_phone" class="cm-profile-field cm-required cm-phone">Phone</label>
	  <input type="text" id="contact_phone" name="phone" size="32" class="input-text cm-skip-avail-switch">
	</div>
	<div class="control-group profile-field-wrap ">
	  <label for="fridge_type" class="cm-profile-field ">Enquiry Type</label>
	  <select name="fridge_type" style="width:200px;">
		<option value="Not specified">Please select</option>
		<option value="Indoor">Indoor</option>
		<option value="Outdoor">Outdoor</option>
	  </select>
	</div>
	<div class="control-group profile-field-wrap">
	  <label for="enquiry_type" class="cm-profile-field">Enquiry Type</label>
	  <select name="enquiry_type" style="width:200px;" id="enquiry_type">
		<option value="Not specified">Please select</option>
		<option value="Sale">Sale</option>
		<option value="Service">Service</option>
	  </select>
	</div>
	<div class="form-field">
	  <p class="strong">File upload (JPG,PDF,PNG files only)</p>
	  <input type="file" name="files[]" multiple="">
	</div>
</div>
<div id="contact_us_message">
	  <p class="strong">Message</p>
	  <textarea id="contact_message" name="message" style="width:100%;height:333px;resize:none;"></textarea>
	  <span id="wrap_button_cart_526" class="button-submit button-wrap-left vs-atc">
		<span class="button-submit button-wrap-right vs-atc">
		  <input id="button_cart_526" type="submit" value="Submit Enquiry" style="font-size:18px;">
		</span>
	  </span>
</div>
<div style="clear:both;">
	<div class="form-field" id="quick_contact_captcha" style="display:inline-block;">
	
	<!--quick_contact_captcha--></div>
</div>
	<input type="hidden" name="dispatch" value="quick_contact.send_mail">
  </form>
<!--quick_contact_container--></div>