Home >php教程 >PHP开发 >jquery gets the value implementation method of easyui date control

jquery gets the value implementation method of easyui date control

高洛峰
高洛峰Original
2016-12-07 13:34:031607browse

In the jquery easyui date control, how to use JS to get the set date value on the page

jquery gets the value of the easyui date control

jquery easyui date box

There is such a date text box:

Use easyui to select the date value for the text box, and then, to Get the latest value in this date box in JS.

I originally thought this was a simple question, just

var dv = $('#mdate').val();

wouldn’t it be OK? But contrary to expectations, what I got was empty. If I assigned an initial value to this text box in the background, no matter what value you select, you will still get the initial value.

The solution is to use easyui's own function to get it:

var dv = $('#mdate').datebox('getValue');

The reason is that easyui has added a hidden In the input form, it assigns the value to that, but it is still very strange that when the form is submitted, the form named mdate still submits the correct value. I suspect that some manipulation was done before submission, and the value is dynamically given The original form is assigned a value. Didn't study it carefully.


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn