Hello, I have a form that i would like to convert from JS onClick to AJAX,
Here is my form:
<form action="" method="post" name="filter"><input id="All" onClick="if(document.forms['filter'].elements['All'].checked)window.location.href='?page=1&filter=All&perpage=10'" name="All" type="checkbox" /><label style="background:#008080; font-size:small" for="All">All</label>
<input id="Pending" style="background:#FF6262" onClick="if(document.forms['filter'].elements['Pending'].checked)window.location.href='?page=1&filter=Pending&perpage=10'" name="Pending" type="checkbox" /><label style="background:#FF6262; font-size:small" for="Pending">Pending</label>
<input id="Complete" style="background:#7BCC70" onClick="if(document.forms['filter'].elements['Complete'].checked)window.location.href='?page=1&filter=Complete&perpage=10'" name="Complete" type="checkbox" /><label style="background:#7BCC70; font-size:small" for="Complete">Complete</label>
<input id="Waiting on parts" style="background:#ffff66" onClick="if(document.forms['filter'].elements['Waiting on parts'].checked)window.location.href='?page=1&filter=Waiting on parts&perpage=10'" name="Waiting on parts" type="checkbox" /><label style="background:#ffff66; font-size:small" for="Waiting on parts">Waiting on parts</label><br>
<input id="Waiting for customer response" onClick="if(document.forms['filter'].elements['Waiting for customer response'].checked)window.location.href='?page=1&filter=Waiting for customer response&perpage=10'" name="Waiting for customer response" style="background:#e4d2ba" type="checkbox" /><label style="background:#e4d2ba; font-size:small" for="Waiting for customer response">Waiting for customer response</label>
</form>
I think AJAX loads faster and easier to implement but I am unsure of how to convert it.
Thanks