Submit form on <select> change

25 views
Skip to first unread message

Pedro Cardoso

unread,
Mar 8, 2019, 6:17:11 PM3/8/19
to 'J' via intercooler-js
Hey Carson,

I’ve been following Intercooler for some time but only now had the opportunity to use it in a project. Better late than never, I hope :)

I’m trying to implement something that I haven’t manage to tackle. I have a form with two <select> elements. I want to submit the form whenever one of the selects change and load the results in another div.

How should I trigger the form ic-post-to on the select change event?

<form ic-target="#results" ic-post-to="/search.php" ic-indicator="#loading" >
<select name="category" class="custom-select" size=“6”>...</select>
<select name=“zone" class="custom-select" size=“6”>...</select>
</form>

ManyThanks!

Carson Gross

unread,
Mar 9, 2019, 12:27:08 AM3/9/19
to Pedro Cardoso, 'J' via intercooler-js
ic-trigger="change" should work, I think.  :)
--
You received this message because you are subscribed to the Google Groups "intercooler-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to intercooler-j...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pedro Cardoso

unread,
Mar 9, 2019, 5:43:01 PM3/9/19
to Carson Gross, 'J' via intercooler-js
Thanks! It worked, but it was ic-trigger-on. Still your help put me on the right track! Thanks! :) 
Reply all
Reply to author
Forward
0 new messages