【发布时间】:2017-04-19 12:00:36
【问题描述】:
<html>
<body>
<form name="trim_video_form" id="trim_video_form" action="video_ajax.php?v=54f85644" method="post">
<input type="hidden" name="action" value="crop_video">
<div class="trim_video_outr">
<!--<iframe src="embed.php?v=54f85644&statTrack=&w=512&h=288&iframe=1&trimmingType=video" width="512" height="288" frameborder="0" scrolling="no" id="trim_video_popup_iframe"></iframe>-->
<iframe src="http://easyweb.site/embed.php?v=54f85644&statTrack=&w=512&h=288&iframe=1&trimmingType=video" width="591" height="335" frameborder="0" scrolling="no" id="trim_video_popup_iframe"></iframe>
</div>
<div class="show_time_row">
From : <input type="text" name="start_time_show" style="width:60px;" class="start_time_show show_time_input">
<input type="hidden" name="start_time" style="width:60px;" class="start_time" value="Left-Flag">
To : <input type="text" name="end_time_show" style="width:60px;" class="end_time_show show_time_input">
<input type="hidden" name="end_time" style="width:60px;" class="end_time" value="24.24641666666667"> Seconds
</div>
<div style="margin:14px 0; color:#676767;">
<input type="radio" name="save_new" class="save_new" value="1" checked="checked"> Save As New Video
<input type="radio" name="save_new" class="save_new" value="0" style="margin-left:15px;"> Overwrite Original<br>
</div>
<div class="trim_video_title">Video Title : <input type="text" name="video_title" value="" class="video_title_input trim_title"><br><br></div>
<input type="button" name="upload" id="trim_image_btn" value="Trim Video" class="blackbtn">
</form>
<input type="hidden" value="">
<input type="submit" >
</form>
</body>
</html>
js代码
function trimVideo(startTime, endTime)
{
$('.start_time').val(startTime);
$('.end_time').val(endTime);
var startTime = secondsToHms(startTime);
var endTime = secondsToHms(endTime);
$('.start_time_show').val(startTime);
$('.end_time_show').val(endTime);
}
php代码
if ($_POST['action'] == "crop_video") { echo '<pre>';var_dump($_POST);die('in ajax');}
js 函数在值变化时被调用。 此 php 代码在 ajax 方法中调用。
我可以看到 value 属性与它的值一起添加到输入字段中。 我正在使用 jQuery 设置输入值。浏览器显示该值。但是当我使用 POST 提交它时,php 文件中的 POST 显示输入值为空。为什么
【问题讨论】:
-
能否请您更新您的完整代码,这些东西不足以给出您的答案,用jquare和php代码更新
-
输入类型隐藏,值被清空,你期望一些数据如何???
-
这是 html 不是 jquery 并且写得很糟糕的 html @AsifUddin 是的也看到了,哈哈
-
是的,这太多了 ;) 大声笑@Gert
标签: javascript php jquery