Why isn't the "subscribe" button working?

The subscribe button would send the artist and email to the "subscriptions" part of the database. When the button is clicked, nothing happens. I am very new to this and can't seem to figure it out. The following is the .html .php and .js files. (the only thing I took out was the background)

<!DOCTYPE html>
        $(function() {
                $("#top-section").load("top-section.html", function() {
                    $.getJSON("php/get_artists.php", function(data) {
                         $.each(data, function() {
        <script src="js/bootstrap.min.js"></script>

        <div id="container">
            <div id="top-section">

        <div style="margin:0 auto;width:75%;text-align:center">
        <form id="artwork-subscribe" enctype="multipart/form-data">
                        <h3>Subscribe to Artist</h3>
                        <div class="inputs">
                         <label>Artist   </label>
                         <select id="artist-dropdown" form="artwork-subscribe" name="uniqueID"></select><br>
                         <label>Email   </label>  
                         <input id="email" type="text" name="email"><br>
                            <input id="submit-email" type="button" value="Subscribe" >
         <label id="artwork-status"></label>


$(document).ready(function() {
    $("#artwork-subscribe").on("subscribe", function() {
        var $stat = $("#artist-status");
        var $form = $("#artwork-subscribe");

        if (!isFilled($form)) {
            alert("Must complete all fields.");
        $.post("php/subscribe_artists.php", $(this).serialize())
        .success(function(data) {
            var response = $.parseJSON(data);
            if (response.stat == "success") {
            } else if (response.stat == "error") {
        .fail(function(data) {
            $stat.text("Failed: " + data);

    function isFilled($form) {
        var filled = true;
        $.each($form.serializeArray(), function(i, field) {
            if (field.value.trim() == "") {
                filled = false;

        return filled;

    function getArtists($dropdown) {
        $.getJSON("php/get_artists.php", function(data) {
            $.each(data, function() {

    require "db_connect.php";

//validates email
    $email = test_input($_POST["email"]);
    if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$email))
                $emailErr = "Invalid email format"; 
//enter into table
$email = mysqli_real_escape_string($_POST['email']);
$sql = "INSERT INTO subscriptions (email) VALUES ('$email')";
$result = mysql_query($sql);

//select from artist
$artist = mysqli_real_escape_string($con,$_POST["artist"]);
    $artist_name = "";
    $result = mysqli_query($con, "SELECT artist FROM artists where id=".$artist);
    while($row = mysqli_fetch_array($result)) {
        $artist_name = $row['artist'];


Try this:





And This:

<input id="submit-email" type="button" value="Subscribe" >


<input id="submit-email" type="submit" value="Subscribe" >

Need Your Help

Equality of values doesn't carry over to types depending on those values; am I missing something?

dependent-type idris

I'm trying to implement as much of System F (polymorphic lambda calculus) as I can in Idris. I'm now faced with a problem that I want to demonstrate with an example: