<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="https://apis.google.com/js/api.js"></script>

<script type="text/javascript">
    /** This section is only needed once per page if manually copying **/
    if (typeof MauticSDKLoaded == 'undefined') {
        var MauticSDKLoaded = true;
        var head            = document.getElementsByTagName('head')[0];
        var script          = document.createElement('script');
        script.type         = 'text/javascript';
        script.src          = 'https://sas.emuaj.in/media/js/mautic-form.js';
        script.onload       = function() {
            MauticSDK.onLoad();
        };
        head.appendChild(script);
        var MauticDomain = 'https://sas.emuaj.in';
        var MauticLang   = {
            'submittingMessage': "Please wait..."
        }
    }
</script>


<style type="text/css" scoped>
    .mauticform_wrapper { max-width: 600px; margin: 10px auto; }
    .mauticform-innerform {}
    .mauticform-post-success {}
    .mauticform-name { font-weight: bold; font-size: 1.5em; margin-bottom: 3px; }
    .mauticform-description { margin-top: 2px; margin-bottom: 10px; }
    .mauticform-error { margin-bottom: 10px; color: red; }
    .mauticform-message { margin-bottom: 10px;color: green; }
    .mauticform-row { display: block; margin-bottom: 20px; }
    .mauticform-label { font-size: 1.1em; display: block; font-weight: bold; margin-bottom: 5px; }
    .mauticform-row.mauticform-required .mauticform-label:after { color: #e32; content: " *"; display: inline; }
    .mauticform-helpmessage { display: block; font-size: 0.9em; margin-bottom: 3px; }
    .mauticform-errormsg { display: block; color: red; margin-top: 2px; }
    .mauticform-selectbox, .mauticform-input, .mauticform-textarea { width: 100%; padding: 0.5em 0.5em; border: 1px solid #CCC; background: #fff; box-shadow: 0px 0px 0px #fff inset; border-radius: 4px; box-sizing: border-box; }
    .mauticform-checkboxgrp-row {}
    .mauticform-checkboxgrp-label { font-weight: normal; }
    .mauticform-checkboxgrp-checkbox {}
    .mauticform-radiogrp-row {}
    .mauticform-radiogrp-label { font-weight: normal; }
    .mauticform-radiogrp-radio {}
    .mauticform-button-wrapper .mauticform-button.btn-default, .mauticform-pagebreak-wrapper .mauticform-pagebreak.btn-default { color: #5d6c7c;background-color: #ffffff;border-color: #dddddd;}
    .mauticform-button-wrapper .mauticform-button, .mauticform-pagebreak-wrapper .mauticform-pagebreak { display: inline-block;margin-bottom: 0;font-weight: 600;text-align: center;vertical-align: middle;cursor: pointer;background-image: none;border: 1px solid transparent;white-space: nowrap;padding: 6px 12px;font-size: 13px;line-height: 1.3856;border-radius: 3px;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}
    .mauticform-button-wrapper .mauticform-button.btn-default[disabled], .mauticform-pagebreak-wrapper .mauticform-pagebreak.btn-default[disabled] { background-color: #ffffff; border-color: #dddddd; opacity: 0.75; cursor: not-allowed; }
    .mauticform-pagebreak-wrapper .mauticform-button-wrapper {  display: inline; }
</style>
<div id="mauticform_wrapper_contactformbridgesaw" class="mauticform_wrapper">
    <form autocomplete="false" role="form" method="post" action="https://sas.emuaj.in/form/submit?formId=275" id="mauticform_contactformbridgesaw" data-mautic-form="contactformbridgesaw" enctype="multipart/form-data">
        <div class="mauticform-error" id="mauticform_contactformbridgesaw_error"></div>
        <div class="mauticform-message" id="mauticform_contactformbridgesaw_message"></div>
        <div class="mauticform-innerform">

            
          <div class="mauticform-page-wrapper mauticform-page-1" data-mautic-form-page="1">

            <div id="mauticform_contactformbridgesaw_f_name" data-validate="f_name" data-validation-type="text" class="mauticform-row mauticform-text mauticform-field-1 mauticform-required">
                <input id="mauticform_input_contactformbridgesaw_f_name" name="mauticform[f_name]" value="" placeholder="Name*" class="mauticform-input" type="text">
                <span class="mauticform-errormsg" style="display: none;">This is required</span>
            </div>

            <div id="mauticform_contactformbridgesaw_phone" data-validate="phone" data-validation-type="text" class="mauticform-row mauticform-text mauticform-field-2 mauticform-required">
                <input id="mauticform_input_contactformbridgesaw_phone" name="mauticform[phone]" value="" placeholder="Phone*" class="mauticform-input" type="text">
                <span class="mauticform-errormsg" style="display: none;">This is required</span>
            </div>

            <div id="mauticform_contactformbridgesaw_email" class="mauticform-row mauticform-email mauticform-field-3">
                <input id="mauticform_input_contactformbridgesaw_email" name="mauticform[email]" value="" placeholder="Email" class="mauticform-input" type="email">
                <span class="mauticform-errormsg" style="display: none;"></span>
            </div>

            <div id="mauticform_contactformbridgesaw_f_message" class="mauticform-row mauticform-text mauticform-field-4">
                <textarea id="mauticform_input_contactformbridgesaw_f_message" name="mauticform[f_message]" placeholder="Requirement" class="mauticform-textarea"></textarea>
                <span class="mauticform-errormsg" style="display: none;"></span>
            </div>

                <input id="mauticform_input_contactformbridgesaw_lead_source" name="mauticform[lead_source]" value="https://www.bridgesawusa.com" class="mauticform-hidden" type="hidden">
            <div id="mauticform_contactformbridgesaw_captcha1" data-validate="captcha1" data-validation-type="captcha" class="mauticform-row mauticform-text mauticform-field-6 mauticform-required">
                <label id="mauticform_label_contactformbridgesaw_captcha1" for="mauticform_input_contactformbridgesaw_captcha1" class="mauticform-label">captcha</label>
                <input id="mauticform_input_contactformbridgesaw_captcha1" name="mauticform[captcha1]" value="" placeholder="Are You Human?" class="mauticform-input" type="text">
                <span class="mauticform-errormsg" style="display: none;">This is required.</span>
            </div>

            <div id="mauticform_contactformbridgesaw_submit" class="mauticform-row mauticform-button-wrapper mauticform-field-7">
                <button type="submit" name="mauticform[submit]" id="mauticform_input_contactformbridgesaw_submit" value="" style="line-height: 1.5;background-color:#008891;border: none; color: white; text-align: center;text-decoration: none;display: inline-block; font-size: 20px;margin: 4px 2px; cursor: pointer;padding: 8px 20px;word-wrap: break-word; class=" mauticform-button>Submit</button>
            </div>
            </div>
        </div>

        <input type="hidden" name="mauticform[formId]" id="mauticform_contactformbridgesaw_id" value="275">
        <input type="hidden" name="mauticform[return]" id="mauticform_contactformbridgesaw_return" value="">
        <input type="hidden" name="mauticform[formName]" id="mauticform_contactformbridgesaw_name" value="contactformbridgesaw">

        </form>
</div>

<script>
    var url = window.location.href; 
    /*$(document).ready(function(){
          $('#mauticform_input_rubberformws_lead_source').append("<option value='"+url+" + Whole Sale' selected> Whole Sale</option>");
    }); */
   
      $(document).ready(function(){
          $('#mauticform_input_contactformbridgesaw_submit').click(function(){
             contactForm();
			 
          });
      });  
</script>

<script>
function contactForm()
    {   var url = window.location.href.split('#')[0]; 
        var field1 = $("#mauticform_input_contactformbridgesaw_f_name").val();
        var field2 = $("#mauticform_input_contactformbridgesaw_phone").val();
        var field3 = $("#mauticform_input_contactformbridgesaw_email").val();
        var field4 = $("#mauticform_input_contactformbridgesaw_f_message").val();
		//var field5 = $("#mauticform_input_contactform_lead_source").val();
		var field5 =url + ' + Contact';
		//var field6 = $("#mauticform_input_rsmcontactform_website").val();
       
       		       // Validate fields
   if (!field1 || !field2) {
        // Show error message if any field is empty
        alert("Please Fill Required Fields.");
        return false;  // Prevent form submission
    }
else{
               
        $.ajax({
url: "https://docs.google.com/forms/d/e/1FAIpQLSfUIcDKgfX1mqeSWE3JuLo1ShsIORzKUFvbTayHX0eA8Qh0Ug/formResponse",
data: {"entry.1737396118": field1, "entry.760033871": field2, "entry.1542924317": field3, "entry.2105357548": field4,"entry.1053271339": field5},
    
// url: "https://docs.google.com/forms/u/0/d/e/1FAIpQLSdP-DZd5DGZM38TZtUKrFRBuh5vDmVsXZAudx51wtLlNXI-5g/formResponse",
// data: {"entry.1251720729": field1, "entry.746654238": field2, "entry.574360142": field3, "entry.634609468": field4, "entry.1533748469": field5},


            type: "POST",
            dataType: "xml",
            success: function(d)
            {
            },
            error: function(x, y, z)
                {
                    $('#success-msg').show();
                    $('#formfield').hide();
                }
          });
        }
        
    }

</script>

         