jquery datepicker not sending data on using .serialize() for populating the grid

前端 未结 1 1046
天命终不由人
天命终不由人 2021-01-26 12:39

I have a form with 2 input type=\"text\" , 1 combo box and other contains ( combo box contains equal , after,before & between operators + start date(jquery datepicker)+end d

相关标签:
1条回答
  • 2021-01-26 13:06

    The problem is very easy. If you want that the input fields with ids "sdate" and "edate" having datepicker will be serialized under the names startDate and endDate you have to modify your HTML code from

    <input id="sdate" type="text"  style="width:70px"/>
    <input id="edate" type="text"  style="width:70px"/>
    

    to

    <input id="sdate" name="startDate" type="text" style="width:70px"/>
    <input id="edate" name="endDate"   type="text" style="width:70px"/>
    

    The function jQuery.serialize() serialize only elements which has name attribute. All your <select> have name attribute so they are serialized.

    0 讨论(0)
提交回复
热议问题