Creating a function inside a custom WordPress Plugin [closed]

The reason you are getting error is because you are mixing PHP CODE with JavaScript and HTML.

You cannot just write JavaScript CODE and HTML CODE within PHP. These functions will not work in PHP:

function f(id) {
    document.getelementbyid(id);
}

function submitform() {
    f("mybutton").disabled = 'true';
}

For JavaScript you need you use wp_enqueue_script function to add JavaScript CODE in the frontend.

For HTML, you need to get out of PHP mode properly. Like this:

function plugin_sql_admin()
{
    ?>
    <form id="my_form" onSubmit="submitForm(); return false;">
        <p> <input id="mybtn" type="submit" value="Submit Form"><span id="status"></span> </p>
    </form>
    <?php
}