我有一个MVC应用程序与多个窗体。提交表单时,它将用户gps坐标传递给服务器。我也想传递客户端当前的日期时间。客户端窗体提交日期时间,MVC应用程序
有没有人有任何想法,以最好的方式来做到这一点?
这些表格是标准的html表单,并使用基本的提交。
我的表单看起来像下面那样。那么我怎样才能最好地将JavaScript日期时间值附加到提交调用?
@using (Ajax.BeginForm("CheckIn", "Home", "Nothing", new AjaxOptions { }))
{
<fieldset>
<p>Move your Tile here to let those around you see it...</p>
<input type="hidden" name="lat" id="hckLat" value="" />
<input type="hidden" name="lon" id="hckLon" value="" />
<input type="hidden" name="date" id="hckDate" value="" />
<input type="submit" value="Check In!" />
</fieldset>
}
什么部分不清楚?如何在JavaScript中创建日期?如何将它的值赋给表单输入? – RedFilter