<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
	 
         <script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<div id="mauticform_wrapper_metalindustry" class="dpeoire mauticform_wrapper">
    <form autocomplete="false" role="form" method="post" action="https://sas.emuaj.in/form/submit?formId=277" id="mauticform_metalindustry" data-mautic-form="metalindustry" enctype="multipart/form-data">
        <div class="mauticform-error" id="mauticform_metalindustry_error"></div>
        <div class="mauticform-message" id="mauticform_metalindustry_message"></div>
        <div class="soeioezmnj nsmwq zclxn mauticform-innerform">

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

                  <div class="ojwdc koilmn">
            <div id="mauticform_metalindustry_f_name" data-validate="f_name" data-validation-type="text" class="form-floating mauticform-row mauticform-text mauticform-field-1 mauticform-required">
                <input id="mauticform_input_metalindustry_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>
 <div class="ojwdc">
            <div id="mauticform_metalindustry_phone" data-validate="phone" data-validation-type="text" class="form-floating mauticform-row mauticform-text mauticform-field-2 mauticform-required">
                <input id="mauticform_input_metalindustry_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>
           

            <div id="mauticform_metalindustry_email" data-validate="email" data-validation-type="email" class="form-floating mauticform-row mauticform-email mauticform-field-3 mauticform-required">
                <input id="mauticform_input_metalindustry_email" name="mauticform[email]" value="" placeholder="Email" class="mauticform-input" type="email">
                <span class="mauticform-errormsg" style="display: none;">This is required</span>
            </div>

            <div id="mauticform_metalindustry_f_message" data-validate="f_message" data-validation-type="textarea" class="form-floating mauticform-row mauticform-text mauticform-field-4 mauticform-required">
                <textarea id="mauticform_input_metalindustry_f_message" name="mauticform[f_message]" placeholder="Requirement" class="mauticform-textarea"></textarea>
                <span class="mauticform-errormsg" style="display: none;">This is required</span>
            </div>

                <input id="mauticform_input_metalindustry_lead_source" name="mauticform[lead_source]" value="https://www.metalstamping-dies.com" class="mauticform-hidden" type="hidden">
            <div id="mauticform_metalindustry_yes_lets_discuss_further" class="oeowppe mauticform-row mauticform-button-wrapper mauticform-field-6">
                <button type="submit" class="idpw oejipe" name="mauticform[yes_lets_discuss_further]" id="mauticform_input_metalindustry_yes_lets_discuss_further" value="" style="line-height: 1.5;background-color:#000 !important;border: none; color: white; text-align: center;text-decoration: none;display: inline-block; font-size: 16px;margin: 4px 2px; cursor: pointer;padding: 8px 20px;word-wrap: break-word;" class="btn btn-primary py-3 px-5 mauticform-button">Yes, Let's Discuss Further!</button>
            </div>
            </div>
        </div>

        <input type="hidden" name="mauticform[formId]" id="mauticform_metalindustry_id" value="277">
        <input type="hidden" name="mauticform[return]" id="mauticform_metalindustry_return" value="">
        <input type="hidden" name="mauticform[formName]" id="mauticform_metalindustry_name" value="metalindustry">

        </form>
</div>

<script>
  var url = window.location.href; 
  $(document).ready(function(){
      //$('#mauticform_input_rubberformchat_lead_source').append("<option value='"+url+" + chat' selected> Chat</option>");
        $('#mauticform_input_metalindustry_yes_lets_discuss_further').click(function(){
           industry();
        });
    });
</script>

<script>
function industry()
    {
        var url = window.location.href.split('#')[0]; 
        var field1 = $("#mauticform_input_metalindustry_f_name").val();
        var field2 = $("#mauticform_input_metalindustry_phone").val();
        var field3 = $("#mauticform_input_metalindustry_email").val();
        var field4 = $("#mauticform_input_metalindustry_f_message").val();
	//	var field5 = $("#mauticform_input_chatformrmp_lead_source").val();
		var field5 =url + ' + Metal Industry- BookService';
		
	  if(field1==''){  alert("Please Fill Mandatory Fields."); return false; }
    if(field2==''){  alert("Please Fill Mandatory Fields."); return false; }
        //if(field3==''){  return false; }
        //if(field4==''){  return false; }
    /*    if(!field1 || !field2){
            alert("Please Fill Mandatory Fields");
            return false;
            
        }*/
       else{
               
        $.ajax({
//url: "https://docs.google.com/forms/d/e/1FAIpQLScDCOdedydrCv-09srV15lAqR1-InsY5Eaogz-Lt4yWqATrgQ/formResponse",
//data: {"entry.1902069042": field1, "entry.941969064": field2, "entry.1510698678": field3, "entry.751273144": field4,"entry.1588330093": 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>