javascript - I am trying to get current date with form select option and display next seven days on submit -


If current date is 3/11/14 and user raises on Wednesday 3/12/14, 3/19 / 14, 3/26/14, 4/2/14, 4/9/14, 4/16/14 should be printed.

HTML

  & lt; Div class = "farm group" & gt; & Lt; Select ID = "Select" placeholder = "week's favorite day" & gt; & Lt; Option selected = "selected" & gt; & Lt; / Option & gt; & Lt; Option value = "1" & gt; Monday & lt; / Options & gt; & Lt; Option value = "2" & gt; Tuesday & lt; / Options & gt; & Lt; Option value = "3" & gt; Wednesday & lt; / Options & gt; & Lt; Option value = "4" & gt; Thursday & lt; / Options & gt; & Lt; Option value = "5" & gt; Friday & lt; / Options & gt; & Lt; Option value = "6" & gt; Saturday & lt; / Options & gt; & Lt; Option value = "7" & gt; Sunday & lt; / Options & gt; & Lt; / Select & gt; & Lt; / Div & gt; JAVASCRIPT $ (document) .ready (function () {var current data = new date (); $ ("select #"). Val (current date .getDate ());});    

Try this one

  $ (document) ) .ready (function () {$ ("# selectDay"). change (function () {var day = parseInt ($ ("# selectDay"). Val (); Var current data = new date (); var offset = Current date .getDay () & lt; days? 0: 7; var adidis = days + offset - for current date .getDay (); (var i = 0; i <4; i ++) {current Date (date == 0) {addDays = 7}}}}}};    

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -