<form id="form1" name="form1" method="post" action=""> <label> <select name="select" id="select"> <option>Category 1</option> <option selected="selected">Category 2</option> <option>Category 3</option> </select> </label> <br /> </form> <table width="164" border="2" cellspacing="2" cellpadding="2"> <tr> <th width="374" scope="col"><a href="#" class="listennow" onclick="var w=window.open('http://site.com','mywindow','width=366,height=335,top=180,left=450,menubar=no,status=no,directories=no,copyhistory=no,location=no,toolbar=no,scrollbars=no,resizable=yes'); w.focus(); return false; ">category 2 open new windows<br /> </a></th> </tr> </table> PHP: i have this menu list and table. i want when i click category 2 this table replaced category 2 table in category 2 table i have different codes (javascript and html) please help, thanks.
Do you use Jquery? It would make thinks a bit less complicated, although it shouldn't be to difficult in javascript. If you give me a minute. <html> <head> </head> <script> var selection=1; function changeSelect() { e=document.getElementById("select"); selection=e.options[e.selectedIndex].id; document.getElementById("nr").innerHTML=selection; } function openWindow() { var w=window.open('http://127.0.0.1/?url='+selection,'mywindow','width=366,height=335,top=180,left=450,menubar=no,status=no,directories=no,copyhistory=no,location=no,toolbar=no,scrollbars=no,resizable=yes'); w.focus(); return false; } </script> <body> <form id="form1" name="form1" method="post" action=""> <label> <select name="select" id="select" onChange="changeSelect()"> <option id="1">Category 1</option> <option id="2" selected="selected">Category 2</option> <option id="3">Category 3</option> </select> </label> <br /> </form> <table width="164" border="2" cellspacing="2" cellpadding="2"> <tr> <th width="374" scope="col"><a href="#" class="listennow" onclick="openWindow()">category <span id="nr">2</span> open new windows<br /> </a></th> </tr> </table> </body> </html> Code (markup): This should do it
thanks you but there is different links if i choose category 2 i want to show people this and if i choose category 3 i need to show people this please help