0

I have a datepicker on my site - In the head i include a load of js files and then in the body all that is needed is to write :

<form class="form-horizontal row-border" action="#">
<div class="form-group">                            
<div class="inlinepicker datepicker-liquid"></div>
</form> 

When the page is loaded, the DatePicker renders and is interactive and you can select a date, i just have absolutely no idea how to get an output from it? Im used to <input name='abc'> in order to get outputs from forms and pass to php files etc.

What i need to do, is to get the output from the form and pass through to a php file which will do a few things with it.

Could someone please offer any advice? D:. Thanks.

4

2 回答 2

0

您可以处理提交按钮单击或表单提交,获取其中的日期选择器值并将其放在隐藏字段中。

<form class="form-horizontal row-border" action="#">
    <div class="form-group">
        <div class="inlinepicker datepicker-liquid">
        </div>
    </div>
    <input type="hidden" name="datePickerValue" id="hdnDatePickerValue" />
    <input type="button" onclick="onSubmit()" value="Submit" />
</form>
<script>
    function onSubmit() {
        $("#hdnDatePickerValue").val($("#datepicker").val());
    }
</script>
于 2013-10-08T10:23:33.873 回答
0

日期选择器

<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
<body>
Date: <input type="text" id="datepicker" />
</body>

从输入标签的 id 中$("#datepicker").val();,你可以得到值。

于 2013-10-08T10:16:30.050 回答