marcus Posted April 16, 2007 Share Posted April 16, 2007 <script type="text/javascript"> function insert(el,ins) { if (el.setSelectionRange){ el.value = el.value.substring(0,el.selectionStart) + ins + el.value.substring(el.selectionStart,el.selectionEnd) + el.value.substring(el.selectionEnd,el.value.length); } else if (document.selection && document.selection.createRange) { el.focus(); var range = document.selection.createRange(); range.text = ins + range.text; } } </script> <form> <input type="button" value="Quote This User" onclick="insert(this.form.reply,'[quote=username]their message[/quote]')"> <br /> <textarea rows="7" cols="30" name="reply"></textarea> Is what I'm trying to do, it make the input type="button" a normal a href="#" link, but act the same way as the input button. Quote Link to comment Share on other sites More sharing options...
Zeon Posted April 16, 2007 Share Posted April 16, 2007 never tried it, but this should work: <form id="someform"> [...] </form> <a href="#" onclick="submitform();return false;">submit form</a> function submitform(){ var form = document.getElementById('someform') form.submit() } Quote Link to comment Share on other sites More sharing options...
marcus Posted April 16, 2007 Author Share Posted April 16, 2007 Well I want the link the act the same way as the input button I have posted. 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.