Homepage Forums Dev & Debugging What’s going wrong? I am looking for form validation onkeyup Reply To: What’s going wrong? I am looking for form validation onkeyup

  • Avery Walter

    Member
    December 23, 2020 at 12:44 pm
    12 Coins
    0 Gems
    Level: Rookie
    Helpful
    Up
    0
    Down
    Not Helpful

    JQuery form validation will be the way to go.

    <style>
    .error { color: red; }
    </style>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.js"></script>
    <script>
    $(document).ready(function() {
    // validate signup form on keyup and submit
    $("#omfg").validate({
    rules: {
    omfgdood: "required"
    },
    messages: {
    omfgdood: "Oy! It\'s Empty!"
    }
    });
    });
    </script>
    <?php $sk['chat']['recipient']['id'] = 'omfgdood'; ?>
    <form id="omfg">
    <textarea class="auto-grow-input" id="<?php echo $sk['chat']['recipient']['id']; ?>" name="<?php echo $sk['chat']['recipient']['id']; ?>"></textarea>
    <input type="submit" name="submit" value="Submit" />
    </form>

New Report

Close