Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php jquery不将值发送到模式弹出窗口中的另一个输入值_Php_Jquery - Fatal编程技术网

Php jquery不将值发送到模式弹出窗口中的另一个输入值

Php jquery不将值发送到模式弹出窗口中的另一个输入值,php,jquery,Php,Jquery,我的任务是表单包含不同的输入。在保存数据之前,用户必须进行预览。预览加载到包含一些输入的模式弹出窗口中。在模式弹出窗口中显示的输入中,加载用户在表单中输入的值。我写了一些代码。但当我点击预览时,它并没有加载到模式弹出窗口中。有人能帮忙吗。我的密码在这里 <html> <head> <script src="jquery.min.js"></script> <script src="bootstra

我的任务是表单包含不同的输入。在保存数据之前,用户必须进行预览。预览加载到包含一些输入的模式弹出窗口中。在模式弹出窗口中显示的输入中,加载用户在表单中输入的值。我写了一些代码。但当我点击预览时,它并没有加载到模式弹出窗口中。有人能帮忙吗。我的密码在这里

<html>
<head>
    <script src="jquery.min.js"></script>
    <script src="bootstrap-3.4.1/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="bootstrap-3.4.1/css/bootstrap.min.css">
</head>
  <script type="text/javascript">
          $(document).ready(function(){
    
               $('#preview').click(function(){
                   var f_name=$('#name').val();         
                   $('#name1').val(f_name);
            });         
          });   
   </script>
   
   <div class="modal-body">               
     1. Name of the Applicant <input type="text" name="name1" id="name1" required />                   
   </div> 
   
Name of the Applicant                  
<input type="text" name="name" id="name" maxlength="50" required />
<button id="preview" class="btn btn-danger btn-sm">Preview</button>          

$(文档).ready(函数(){
$(“#预览”)。单击(函数(){
var f#u name=$('#name').val();
$('#name1').val(f#u name);
});         
});   
1.申请人姓名
申请人姓名
预览

如何调用模态?
#preview
元素在哪里?很抱歉我错过了。现在它可以正常工作了。