jquery - Html SELECT : send both value and text on submit -
i have select
<select name="country" multiple> <option value="in">india</option> <option value="us">united states</option> </select>
while submitting form if both country selected, default behaviour is, send as:
country=in,country=us
but want send both value , text i.e in
, india
both. how can done
i think should give try:
$("#btnsub").on('click',function(){ // submit button click $(".select option:selected").each(function(i, option){ console.log($(this).val() + "," + $(this).text()); }); return false; });
html
<select class="select" name="country" multiple="multiple"> </select>
Comments
Post a Comment