Kevin Smith
Kevin Smith

Reputation: 731

Resetting a Select after form submit

I've looked at the documentation but I"m trying to figure out that when I clear my form with the resetForm function from the jQuery validation plugin my select element doesn't have the text of the option reset. The value resets but not the text. Did I miss somewhere in the docs that says how that should be done?

Edit: I forgot to mention I am using the select2 plugin for jQuery for my select elements,

Upvotes: 1

Views: 876

Answers (1)

Mike Robinson
Mike Robinson

Reputation: 25159

You have to trigger a change event on the select so that select2 picks it up. I'm not sure if a reset counts.

$("select").trigger("change");

Upvotes: 1

Related Questions