jquery - Getting "on" from input in IE -


here problem have app working in every browser ie(8). simple form filled data ajax requests. @ bottom there button sends data server , gets generated query.

the problem is, @ ie when user presses query button, browser sends checkbox or radiobutton values string "on" although value attribute different "on".

why happening?

i using java , spring mvc(version 3).

i haven't attached code because not sure section of code useful. application medium size so, i'm going post code snippets on demand.

[edit] using developer tools able find value being passed correctly after input set, value becomes "on". checked javascript generated inputs. ones loaded, not know why set way.

here small snippet of dom generation:

 var cell = $("<td/>").append(         $("<input/>")         .attr("id", lista[i].codigo+"radiovariavel")         .attr("name", "consulta.variavel")         .attr("value", lista[i].codigo)         .attr("type", "radio")         ).append(         $("<label/>")         .attr("for", lista[i].codigo+"radiovariavel")         .html(lista[i].descricao)         ); 

i've run similar problem before. i'm suprised not getting outright error, because jquery doesn't allow change input type.

try instead:

$('<input type="radio" />')     .attr("id", lista[i].codigo+"radiovariavel")     .attr("name", "consulta.variavel")     .attr("value", lista[i].codigo); 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -