Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
109 views
in Technique[技术] by (71.8m points)

javascript - how to call multiple files on form submit

i have form in which i want three functionality among two is working. First one is when form gets submit fetch data from db and display on form_process.php file and second is store form data in db on submit, this two is working fine in form_process.php. Now i want to send all form data via email so i want to do process in email_process.php. So how should i call email_process.php ?

i am already using form action for form_process.php

<form class="cost_calculation" action="form_process.php" name="cost_estimation" id="cost_estimation" method="post">

submit button:

  <div class="get_quote_btn">
    <input  class="get_quote" name="submit" id="getquote" type="submit" value="Get Quote" />
    </div>

I tried using ajax but it's not working

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>    
<script type="text/javascript">
     $(document).ready(function(){
     $("input").click(function(){
     $.ajax({url: "email_process.php", success: function(result){
    $("#cost_estimation").html(result);
}});
});
});
</script>

Thanks in advance.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...