Targeting document.getElementById to sub templates?
<p>I cannot get certain fields in a form to unlock. I have a javascript file that works on certain pages, but not on others. </p>

<p>I am using <code>document.getElementById</code> to target form fields to disable or enable them depending on certain inputs. It works fine on one page but not another. I have double checked all my ids and they are correct. Here is the javascript:</p>

<pre><code>var pass2 = document.getElementById("password").value;
     if (pass1 == pass2) {

            //start profile
            document.getElementById("premium-text").innerHTML = "Congratulations! You have unlocked the premium fields!";
            document.getElementById("premium").style.background = "#d1fdd3";
            document.getElementById("premium").style.borderColor = "#019408";
             document.getElementById("description").disabled = false; 
             document.getElementById("fax-number").disabled = false;
             document.getElementById("facebook-url").disabled = false;
             document.getElementById("twitter-url").disabled = false;
             document.getElementById("google-plus-url").disabled = false;
             document.getElementById("linkedin-url").disabled = false;
             document.getElementById("type").disabled = false;
             document.getElementById("city").disabled = false;
             document.getElementById("status").disabled = false;
             document.getElementById("price").disabled = false;
             document.getElementById("bedrooms").disabled = false;
             document.getElementById("bathrooms").disabled = false;
             document.getElementById("size").disabled = false;
             document.getElementById("property-id").disabled = false;
             document.getElementById("video-url").disabled = false;
             document.getElementById("featured").disabled = false;
</code></pre>

<p>The only difference in the pages is one has the form fields in the template (form ids are directly in <code>edit-profile.php</code>) and the other page pulls in the form fields from a sub template that has the ids in it (<code>submit-property.php</code> pulls form fields from a sub template <code>partials/templates/submit-form.php</code>).</p>

<p>What do I need to do to target the fields that are pulled in from the sub-template? The <code>id</code> gets pulled into the page source code so I assumed the <code>document.getElementById</code> would work fine, but it is not for some reason.</p>

<p><a href="http://dev-integrity.myuvn.com/edit-profile-2/" rel="nofollow">On this page</a> the javascript is working but not on <a href="http://dev-integrity.myuvn.com/submit-property/" rel="nofollow">this page</a>. You have to create an account to have access to these pages. The user is <code>test1</code> and pass is <code>testpass</code>.</p>

<p>The password to unlock the form fields is <code>QuL7eD</code></p>