hey all this should be simple. . . I'm making a dynamic search test page, which basically you click male/female and a male/female pic pops up, then you click bodystyle and a fat/average/thin male/female pops up and so on. Here is code I have so far to ge tme started but its majorly wrong. Can someone point me in right direction PLEASE
Code:
<html> <head> <script> function changeImage() { maleimage = "url(Images/searchpictures/male.jpg)"; femaleimage = "url(Images/searchpictures/female.jpg)"; for (i=0; i<document.search.gender.length; i++) { if (document.search.gender[i].checked==true) { gender =document.search.gender[i].value; if (document.search.gender[i].value="male") { alert(male) } elseif (document.search.gender[i].value="female") { alert(*****) } } } //if (document.write.gender='male') // { // document.getElementById('picture').style.backgroundImage = maleimage; // alert(male) // } // elseif (gender.value='female') // { // document.getElementById('picture').style.backgroundImage = femaleimage; // alert(female) // } // alert(document.getElementById('female').value); } </script> </head> <body> <table width=100% height=100% border=10> <tr> <td width=50% height=50% id="picture"></td> </tr> <tr> <td> <form name=search method=post> <input type="radio" name="gender" id="male" value="male" onClick="changeImage()">Male<br> <input type="radio" name="gender" id="female" value="female" onClick="changeImage()">Female<br> </form> <td> </table> </body> </html>
Comment