javascript - Targeting document.getElementById to sub templates? -
i cannot fields in form unlock. have javascript file works on pages, not on others.
i using document.getelementbyid
target form fields disable or enable them depending on inputs. works fine on 1 page not another. have double checked ids , correct. here javascript:
var pass2 = document.getelementbyid("password").value; if (pass1 == pass2) { //start profile document.getelementbyid("premium-text").innerhtml = "congratulations! have unlocked 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;
the difference in pages 1 has form fields in template (form ids directly in edit-profile.php
) , other page pulls in form fields sub template has ids in (submit-property.php
pulls form fields sub template partials/templates/submit-form.php
).
what need target fields pulled in sub-template? id
gets pulled page source code assumed document.getelementbyid
work fine, not reason.
on page javascript working not on this page. have create account have access these pages. user test1
, pass testpass
.
the password unlock form fields qul7ed
make sure don't have same multiple ids. if can post code i'll able assist better.
Comments
Post a Comment