mac007 Posted April 24, 2009 Share Posted April 24, 2009 Hi all: I am pretty new at this javascipt stuff; so I have this simple script where the "onclick removeChild" doenst work as expected? I have to click twice for it to delete each field; also, how can I make it so when clicking the "remove text field" button, it only deletes, let's say text field "one", and not keep on deleting form elements?? Thanks! <html> <head> </head> <body> <script language="JavaScript"> function function2() { myList.removeChild(myList.firstChild); } </script> <input type="button" value="Remove Text field!" onClick="function2();" > <form id="myList" action="" method="get"> <input name="one" type="text" id="one"> <input name="two" type="text" id="two"> <input name="" type="submit"> </form> <br> <br> output text: <?php echo $_GET["one"]. ", " . $_GET["two"]; ?> </body> </html> 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.