Reputation: 11026
I am using jQuery templates to add new items to a list when a button is pressed
The template contains a hidden field.
When I add a new item to the list in IE 8 or IE 9, then the hidden form field is displayed like a visible input field
I've set up a JSfiddle to demonstrate http://jsfiddle.net/T3has/8/
It works fine in Chrome and FF, but not IE
Any ideas?
Upvotes: 2
Views: 610
Reputation: 135
You could add .hide() to the line where you append.
The function .tmpl() is marked as a beta feature in jQuery, and is not being further developed.
"The jQuery team has decided not to take this plugin past beta. It is no longer being actively developed or maintained." Source: http://api.jquery.com/tmpl/
Try using this code instead:
$('#rateItemTemplate').clone().removeAttr('id').appendTo('#Board');
jsFiddle: http://jsfiddle.net/T3has/10/
Upvotes: 0
Reputation: 9924
You're doing it right; the input is of type "hidden", so this is clearly (yet another) bug in IE.
If you want to support IE you may want to try adding a class to those inputs as a hack around this:
<input class="hidden-input" ...
and css
input.hidden-input: {
display: none;
}
Upvotes: 2