Buttero Posted January 31, 2007 Share Posted January 31, 2007 Hey, does anyone know why this insertAtCursor isnt working for me?: <a href="javascript:insertAtCursor($('textarea'),'<img src=%22%22>');">Image</a></code> Thats all the javascript I have, and Im assuming that i dont need to add anything else in the page to make it work. I want it to insert an image tag when you click it, like what we have here on the left. I dont know what to put in the ' ($('textarea'') ' part either. Here is the whole form im using this in: <code><form method="post" action="idontthinkso.php"> <fieldset> <legend>Submit new frontpage news article</legend> <label for="user">Username:</label><br> <select name="user"> <option>Namel</option> </select> <input name="date" type="hidden" value="Wed Jan 31, 2007 "><br> <label for="title">Title:</label><br> <input name="title" type="text"> <br> <a href="javascript:insertAtCursor($('textarea'),'<img src=%22%22>');">Image</a> <label for="description">Description:</label><br> <textarea name="description" cols="50" rows="20" wrap="virtual"></textarea> <br> <p><input name="submit" type="submit" value="Submit"> </p> </fieldset> </form> I am not using prototype, and I dont have a function defined, this is my first time with javascript and I dont know what to do now! ??? Quote Link to comment Share on other sites More sharing options...
fenway Posted January 31, 2007 Share Posted January 31, 2007 And where did this function come from? Quote Link to comment Share on other sites More sharing options...
bibby Posted February 1, 2007 Share Posted February 1, 2007 There was already a thread about this, that had a link to a great script. http://www.phpfreaks.com/forums/index.php/topic,124126.0.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.