addtrain Posted October 2, 2007 Share Posted October 2, 2007 ok...here's the problem so far... i am trying to make an input change from disabled to abled, after two images (myImage1 & 2) have been clicked on....this code that someone gave me earleir didn't work for some reason. how do i do this??? HERE IS THE CODE THAT PERSON GAVE ME THAT DOSEN'T WORK: <script type='text/javascript'> //this code uses variables to change an input //to abled, instead of disabled var myImage1 = false; var myImage2 = false; function check() { if(img1 && img2) document.getElementById('input1').disabled = false; document.getElementById('button').disabled = false; } //end code </script><script type="text/javascript"> Quote Link to comment Share on other sites More sharing options...
emehrkay Posted October 3, 2007 Share Posted October 3, 2007 because i love oop var images = { img1: document.getElementById('image1'), img2: document.getElementById('image2'), img_click: [false, false], actions: function(){ img1.onclick = function(){ img_click[0] = true; images.disable(); }; img2.onclick = function(){ img_click[1] = true; images.disable(); }; }, disable: function(){ if(img_click[0] && img_click[1]){ document.getElementById('input1').disabled = false; document.getElementById('button').disabled = false; } } }; window.onload = images.actions(); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.