Different JS is being called even though a unique ID is already assigned for the function
<p>Hi I have this code "simplified":</p>

<pre><code>&lt;div id = "form1"&gt;
&lt;script&gt;
function dispFields_form_42_4fa4d29ab1f83(a , b, c, z) 
        {
            var valid;
            var blanks = Array();
            var email_reg = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/;
            var myVal = $('#'+a).find('input.required').map(function() {
                                       return $(this).val();
                                       }).get().join(',');
            var myTitle = $('#'+a).find('input.required').map(function() {
                                       return $(this).attr(\"title\");
                                       }).get().join(',');
                var error_form = myVal.split(',');
                var error_title = myTitle.split(',');
                var errorlength = error_form.length;

                for(x=0;x&lt;errorlength;x++)
                {
                    if(error_form[x] == '')
                    {
                            if(myTitle == '')
                            {
                                valid = true;
                            }
                            else
                            {
                            blanks[x] = \"Required - \"+error_title[x];
                            valid = false;
                            }
                    }
                    else
                    {
                        if(error_title[x] == 'Email')
                        {
                            if(email_reg.test(String(error_form[x]).toLowerCase())==false){
                                blanks[x] = error_title[x]+\" - Should be valid email\";
                                valid = false;
                            }
                        }
                        else
                        {
                            if(blanks == '')
                            {
                                valid = true;
                            }
                        }
                    }

                }
                if(blanks == '')
                {
                    valid = true;
                }
                var requiredS = blanks.toString();
                var nblank = requiredS.split(',').join(\"\\n\");

                if(valid != true)
                {   
                    alert(\"Please review:\\n\\n\"+nblank);
                    document.getElementById(a).style.display = \"\";
                    document.getElementById(b).style.display = \"none\";
                }
                else
                {
                    var ssplits = z.split(',');
                    var fieldlengths = ssplits.length;
                    var indexes = fieldlengths - 1;
                    var d;
                    var e;
                    d=parseInt(c,10)+1;
                    e=d-1;

                    if(b == ssplits[indexes])
                    {
                        document.getElementById(a).style.display = \"none\";
                        document.getElementById(b).style.display = \"\";
                        document.getElementById(d).style.color = \"#FF7300\";
                        document.getElementById(e).style.color = \"\";
                        document.getElementById(\"tbutton\").style.display = \"\";
                        document.getElementById(\"tcont\").style.display = \"none\";
                        document.getElementById(\"captchas\").style.display = \"none\";
                    }

                    document.getElementById(d).style.color = \"#FF7300\";
                    document.getElementById(e).style.color = \"\";
                    document.getElementById(a).style.display = \"none\";
                    document.getElementById(b).style.display = \"\";    
                    if(b != \"default\")
                    {
                        document.getElementById(\"captchas\").style.display = \"none\";     
                    }
                }

        }
&lt;/script&gt;
  &lt;div&gt;
  &lt;a href = "#" onclick = "dispFields_form_42_4fa4d29ab1f83()"/&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div id = "form2"&gt;
&lt;script&gt;
same as with form1 but with id = _form_1_4fa4d29ab7a4a
&lt;/script&gt;
   &lt;div&gt;
   &lt;a href = "#" onclick = "dispFields_form_1_4fa4d29ab7a4a()"/&gt;
   &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>Now the problem is when i click a button in form2 that will call its equivalent function, the one being called is the function for form1. i already added a unique id for the functions so that it would only be used within it's respective form.</p>

<p>Why is it still calling the function of form1 even though i already added a unique id to the functions?</p>
