Skip to content
Advertisement

Checkboxs leading to a fetch call to produce data

As a user when I submit this form I want a fetch call for each checkbox that is checked So that I can load information from the API depending on what the selections are.

Using Materialize framework and jquery or plain javascript is fine. Hard question to explain but on form submit I want to bring up information depending on checkbox ticked. Each checkbox should trigger a fetch call to the specific API which will then append data to the new page such as movies availbe on nexflix or amazon prime

JavaScript

Advertisement

Answer

Edit : this snippet fetch every checked element and send a request for each one.

JavaScript
JavaScript

This is what you are looking for ? This example get Data from an API and display a field bellow the first checkbox :

JavaScript
JavaScript
Advertisement