Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/466.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
在javascript函数中创建表单?_Javascript_Php_Html_Laravel - Fatal编程技术网

在javascript函数中创建表单?

在javascript函数中创建表单?,javascript,php,html,laravel,Javascript,Php,Html,Laravel,好的,我有下面的函数和HTML,这是完全可行的,但我希望添加扩展功能。我想知道是否有可能使窗体显示在屏幕上弹出的关闭游戏功能 上图中模糊的是我无法显示的机密信息,但我想知道是否介于“您确定要关闭游戏吗?”和“此操作无法撤消”之间。我可以在那里放置一个表单,然后在按钮右侧的“关闭游戏”按钮上提交此表单并将信息放入数据库 有人知道这样做的好方法吗?或者这是可能的吗? (需要注意的是,该网站基于laravel框架) 势均力敌 是否确实要关闭游戏(序列号:) 此操作无法撤消 取消 势均力敌 功能关闭

好的,我有下面的函数和HTML,这是完全可行的,但我希望添加扩展功能。我想知道是否有可能使窗体显示在屏幕上弹出的关闭游戏功能

上图中模糊的是我无法显示的机密信息,但我想知道是否介于“您确定要关闭游戏吗?”和“此操作无法撤消”之间。我可以在那里放置一个表单,然后在按钮右侧的“关闭游戏”按钮上提交此表单并将信息放入数据库

有人知道这样做的好方法吗?或者这是可能的吗? (需要注意的是,该网站基于laravel框架)


势均力敌
是否确实要关闭游戏(序列号:)

此操作无法撤消

取消 势均力敌 功能关闭游戏(游戏名称,序列号){ $('modal game close name').html(game#u name); $('modal game close serial').html(serial); $(“#确认_关闭”)。关闭('click.close_game')。打开('click.close_game',函数(){ $.ajax({ url:'/game/'+serial+'/', 键入:“PUT”, 成功:功能(数据){ $('#alerts').html('

已成功关闭'+serial+'

'+$('#alerts').html()); $('#r'+serial).hide(); }, 错误:函数(jqXHR、textStatus、errorshown){ $('#alerts').html('

关闭'+serial+'

'+$('#alerts').html()时出现问题; $('#r'+serial).hide(); } }); }); }
你的意思是这样的吗

<div id="myModal_close" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
 <div class="modal-header">
    <button type="button" class="close icon-remove" data-dismiss="modal" aria-hidden="true"></button>
    <h3 id="myModalLabel">Close Game</h3>
 </div>
<div class="modal-body">
<form id="myForm">
    <p><input type="text" id="username"></p>
    <p><input type="text" id="email"></p>
   <p><input type="password" id="password"></p>
</form>
   </div>
 <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
    <button id="submit" data-dismiss="modal" class="btn btn-danger">Submit</button>
 </div>
</div>

势均力敌

取消 提交
哦,就这么简单,嗯。。。但我不认为当按下“结束游戏”按钮时这会起作用,是吗?我需要在javascript函数中添加一些东西,我不想让它提交表单吗?或者否?当然,当单击submit按钮时,您必须编辑JavaScript以提交数据。试试看
<div id="myModal_close" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
 <div class="modal-header">
    <button type="button" class="close icon-remove" data-dismiss="modal" aria-hidden="true"></button>
    <h3 id="myModalLabel">Close Game</h3>
 </div>
<div class="modal-body">
<form id="myForm">
    <p><input type="text" id="username"></p>
    <p><input type="text" id="email"></p>
   <p><input type="password" id="password"></p>
</form>
   </div>
 <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
    <button id="submit" data-dismiss="modal" class="btn btn-danger">Submit</button>
 </div>
</div>