Hi there could somebody help me out with this bit of javascript? <a href="javascript:;" onclick="document.forms[0].a_answer.value=document.forms[0].a_answer.value+'[link=PUT LINK HERE][/link]'"> Link Here </a> <form id="form1" name="form1" method="post"> <textarea name="a_answer" cols="50" rows="5" id="a_answer"></textarea> </form> Code (markup): I have this form and when I click the link the text [link=PUT LINK HERE][/link] is entered into the textbox. Does anybody have any ideas how I could edit my current code so that when the link is clicked the user gets a little popup asking "Please enter the URL of your link:" (like here on DP) and the url that the user types in replaces the words "PUT LINK HERE"?. Thanks
You mean something like this? <script type="text/javascript"> function populate( ) { var value = prompt("Please enter the URL of your link:", "") document.forms[0].a_answer.value = "[link=" + value + "][/link]"; } </script> <a href="#" onclick="populate( );"> Link Here </a> <form id="form1" name="form1" method="post"> <textarea name="a_answer" cols="50" rows="5" id="a_answer"></textarea> </form> Code (markup):