i using october cms , materializecss create options form on 1 of pages. form works fine , dynamically loads content when click through various options. however, have noticed if click on same option 2 times in row content disappears , no new data inserted. loading screen fails appear. debugging has shown no ajax request being fired off. know how can change clicking twice either leave current content on page or reload content on page? below problematic radio element , complete partial.
radio button:
<p class="optrow"> <input onclick="onsend()" type="radio" class="box" id="cat_all" name="dates" value="all" data-request="oneventdeals" checked="checked" data-request-update="'deals::default':'#deals'" data-request-loading="#loading"> <label for="cat_all"> show all</label> </p>
partial:
<ul class="collapsible" data-collapsible="accordion"> <li> <div class="collapsible-header active"><i class="material-icons">format_list_bulleted</i>deal options</div> <div class="collapsible-body"><form id="dealsoptions" class data-request="ontest" data-request-update="calcresult: '#deals'"> {# <p> <a href="#" onclick="onsend()" id="see_all">see deals - clear</a> </p> #} {# <h5><b> deal source</b></h6> <hr> <div id="dealsource"> <p class="optrow"> <input onclick="onsend()" type="checkbox" class="box" id="source_all" name="userproviders[]" value="all" data-request="onlocaldeals" data-request-update="'deals::default': '#deals'" data-request-loading="#loading" data-request-data="clear:1"/> <label for="source_all"> show all</label> </p> {% provider in providers %} <p class="optrow"> <input onclick="onsend()" type="checkbox" class="box sourcebox" id="source_{{ provider.userproviderid }}" name="userproviders[]" value="{{ provider.userproviderid }}" checked="checked" data-request="onlocaldeals" data-request-update="'deals::default': '#deals'" data-request-loading="#loading"/> <label for="source_{{ provider.userproviderid }}"> {{ provider.providername }}</label> </p> {% endfor %} </div> #} <hr> <h5><b> event date</b></h6> <hr> <div id="eventdate"> <p class="optrow"> <input onclick="onsend()" type="radio" class="box" id="cat_all" name="dates" value="all" data-request="oneventdeals" checked="checked" data-request-update="'deals::default': '#deals'" data-request-loading="#loading"/> <label for="cat_all"> show all</label> </p> {% set weekend = "this sunday"|date('y-m-d') %} {% set dates = {'today':{'start':"now"|date("y-m-d"),'end':"now"|date("y-m-d")}, 'tomorrow':{'start':"now"|date_modify("+1 day")|date("y-m-d"),'end':"now"|date_modify("+1 day")|date("y-m-d")}, 'this_weekend':{'start':"this sunday"|date_modify("-2 day")|date('y-m-d'),'end':weekend}, 'this_week':{'start':"now"|date("y-m-d"),'end':weekend}, 'this_month':{'start':"now"|date("y-m-d"),'end':"now"|date("y-m-t")}} %} {% key,date in dates %} <p class="optrow"> <input onclick="onsend()" type="radio" class="box type_{{ key }}" id="cat_{{ key }}" name="dates" value="{{ date.start }}:{{ date.end }}" data-request-data="start:'{{ date.start }}',end:'{{ date.end }}'" data-request="oneventdeals" data-request-update="'deals::default': '#deals'" data-request-loading="#loading"/> <label for="cat_{{ key }}"> {{ key|replace({'_':' '})|title }}</label> </p> {% endfor %} </div> {% partial 'deals::apps' %} </form> </div> </li> </ul>
i notice have onclick="onsend()"
on input, might causing problem ajax handler fired off. try removing , see if progresses further.
Comments
Post a Comment