Hello, i need to make 2 links and every one of them open different form so i need some thing like this Link 1 - Link 2 Form when i click on "Link 1" it opens the form when i click on "Link 3" it opens another form in the same place of form 1 how can i do this ? i believe it's some kind of java script
Try this code. I hope this is what you want. <html> <head> <script type="text/javascript"> <!-- var arElems = new Array('id1', 'id2', 'id3'); function toggle(id){ for(i in arElems){ el = document.getElementById(arElems[i]); if(id == arElems[i])el.style.display = ''; else el.style.display = 'none'; } } //--> </script> </head> <body> <a href="javascript:toggle('id1');">Form 1</a> :: <a href="javascript:toggle('id2');">Form 2</a> :: <a href="javascript:toggle('id3');">Form 3</a> <div id='id1' style="display:;"> <form name='form1'> <span>First Form</span><br/> <input type="text" name="txt_1_1"/><br/> <input type="text" name="txt_1_2"/><br/> <input type="submit" value="Submit Form 1"/> </form> </div> <div id='id2' style="display:none;"> <form name='form2'> <span>Second Form</span><br/> <input type="text" name="txt_2_1"/><br/> <textarea></textarea><br/> <input type="submit" value="Submit Form 2"/> </form> </div> <div id='id3' style="display:none;"> <form name='form3'> <span>Third Form</span><br/> <input type="text" name="txt_3_1"/><br/> <input type="text" name="txt_3_2"/><br/> <input type="text" name="txt_3_3"/><br/> <input type="submit" value="Submit Form 3"/> </form> </div> </body> </html> HTML: