Sarit Rotshild
Sarit Rotshild

Reputation: 391

select2- trigger reset doesn't work

I'm using select to in my app for selecting option from the dropdown. The select2 is implemented on input list I have in a form I want to reset all the form when the user click on cancel.

I try

 $(idOfTheForm).trigger(reset) 

but the selecting results which display in the inputs are not reset.

Upvotes: 1

Views: 215

Answers (1)

egvrcn
egvrcn

Reputation: 984

You can use this code for the reset

$("#select_id").select2("val", "");

Upvotes: 3

Related Questions