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.