I was wondering if there was a way to know, in javascript, which form is active or which form the user is accessing?

Thanks in advance!

Attach an event handler to the form element which would be fired as soon as the element gets focus and which would update the form name variable. Something like:

<html>
<head>
    <script type="text/javascript">
    function doSome(e)
    {
        alert("Name: " + e.form.name + "  ===== ID: " + e.form.id);
    }
    </script>
</head>
<body>
    <form name="frmName" id="frmID">
        <input type="text" id="txt1" onfocus="doSome(this);" />
    </form>
</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.