javascript - keep spring form select value -
i use spring mvc 4 bring list , show on website
<s:select path="almacenesbyalmori.codalm" id="select1" name="select1" onchange="tr_enviaralmacen('select1');" items="${listalmacen}" itemvalue="codalm" itemlabel="nomalm" class="form-control input-sm"></s:select> <script> function tr_enviaralmacen(sel){ var cbox = document.getelementbyid(sel); var valor = cbox.options[cbox.selectedindex].value; var red = "getprodxalm?cod_alm="+valor; location.href = red; } </script>
as can keep option of select spring form selected reloading page?
view rendered server everytime refresh(i mean 'hard refresh' without browser caching) page, means model refreshed , proper selected values injected in view(the values wich posted , saved).
to keep selected option while refresh page have use ajax. need http post selected options everytime user selects in select form.
Comments
Post a Comment