dongqin1075 2017-06-15 13:47
浏览 28
已采纳

在弹出窗口中显示值

I want to show form value in pop up window which is open after clicking submit button. how can i show form value in pop up window after clicking submit button. My Form is below

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<form name="example" action="" method="post">
<table width="257" border="1">
  <tr>
    <td>Name</td>
    <td><input type="text" name="name" id="name" /></td>
  </tr>
  <tr>
    <td>Father Name</td>
    <td><input type="text" value="" name="fname" id="fname" /></td>
  </tr>
  <tr>
    <td colspan="2"><center><input type="submit" name="submit" value="Show Value" /></center></td>    
  </tr>
</table>
</form>
</body>
</html>
  • 写回答

2条回答 默认 最新

  • doujie9252 2017-06-15 13:59
    关注

    Get data using input id and set form delay for submit and read javascript and jquery basic concept on w3 school

    <html>
    <head>
        <title>Demo</title>   
    
     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>
        <link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/blitzer/jquery-ui.css"
            rel="stylesheet" type="text/css" />
    </head>
    
    <body>
    
    <form name="example" action="" method="post" id="example">
    <table width="257" border="1">
      <tr>
        <td>Name</td>
        <td><input type="text" name="name" id="name" /></td>
      </tr>
      <tr>
        <td>Father Name</td>
        <td><input type="text" value="" name="fname" id="fname" /></td>
      </tr>
      <tr>
        <td colspan="2"><center> <input type="button" id="btnShow" value="Submit" /></center></td>    
      </tr>
    
    </table>
    </form>
    
        <div id="dialog" style="display: none" align="center">
              <label>Name :</label><span id="show_name"></span>
              <br>
             <label>Father Name :</label><span id="show_fname"></span>
    
        </div>
    </body>
    </html>
    
    <script>
    
    
            $(function () {
               $("#dialog").dialog({
                    modal: true,
                    autoOpen: false,
                    title: "User Details",
                    width: 300,
                    height: 150,
                });
                $("#btnShow").click(function (e) {
    
                   e.preventDefault();
                    var name=$("#name").val();
                    var fname=$("#fname").val();
    
                    $("#show_name").html(name);
                    $("#show_fname").html(fname);
    
                   $('#dialog').dialog('open');
    
                 setTimeout(function() {
                     $("#example").submit();
                  }, 3000);
    
               });
    
    
            });
    
    
    </script>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 一道python难题2
  • ¥15 一道python难题
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备