<commit_before>﻿@model dynamic
@{
    ViewBag.Title = "title";
}

<h2>Donate Food</h2>
<ul id="items_container"></ul>
<input type="text" id="item_name" placeholder="Item name..." />
<input type="number" id="item_quantity" value="1" />
<input type="submit" id="add_item"/>

<script type="text/javascript" src="~/Scripts/jquery-2.0.3.js"></script>
<script type="text/javascript">

    $("#add_item").click(function () {
        $("#items_container").append('<li>' + $("#item_name").val() + ' - ' + $("#item_quantity").val() + '</li>');
    });

</script><commit_msg>added validation to add item button<commit_after>﻿@model dynamic
@{
    ViewBag.Title = "title";
}

<h2>Donate Food</h2>
<ul id="items_container"></ul>
<input type="text" id="item_name" placeholder="Item name..." />
<input type="number" id="item_quantity" value="1" />
<input type="submit" id="add_item" disabled="disabled"/>

<script type="text/javascript" src="~/Scripts/jquery-2.0.3.js"></script>
<script type="text/javascript">

    function submit() {
        $("#items_container").append('<li>' + $("#item_name").val() + ' - ' + $("#item_quantity").val() + '</li>').slideDown();
        $("#item_name").val("");
        $("#item_quantity").val("1");
        $("#add_item").attr('disabled', 'disabled');
    }

    $("#item_name").change(function() {
        if ($("#item_name").val().length === 0)
            $("#add_item").attr('disabled', 'disabled');
        else
            $("#add_item").removeAttr('disabled');
    });
    
    $("#add_item").click(submit);

</script>
{'fraction_non_alphanumeric': 0.25679172056921085, 'fraction_numerical': 0.009055627425614488, 'mean_word_length': 4.122516556291391, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4313804', 'n_tokens_mistral': 509, 'n_tokens_neox': 508, 'n_words': 81}