jsp - jQuery datepicker works but Spring controller gets null date -


i know should quite simple don't see problem. have these 2 jquery datepickers:

<script>             $(function() {                 $( "#inidate" ).datepicker({ dateformat: "dd-mm-yy", firstday: 1, changeyear: true });                 $( "#enddate" ).datepicker({ dateformat: "dd-mm-yy", firstday: 1, changeyear: true });             }); </script> 

and jsp:

<form:form method="post" action="result" commandname="mainform">       <p>fecha inicio: <input type="text" id="inidate" path="inidate"/></p>       <p>fecha fin: <input type="text" id="enddate" path="enddate"/></p>       <p class="submit"><input type="submit" name="commit" value="go"></p> </form:form> 

when click on text box , select date, copied in field, when submit form "null" when reading value in controller handles post method.

any ideas?

try give name input fileds , if not uses remove path

<p>fecha inicio: <input type="text" id="inidate" name="inidate"/></p> <p>fecha fin: <input type="text" id="enddate" name="enddate"/></p> 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -