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! ??? Link to comment https://forums.phpfreaks.com/topic/36514-insertatcursor-not-working/ Share on other sites More sharing options...
fenway Posted January 31, 2007 Share Posted January 31, 2007 And where did this function come from? Link to comment https://forums.phpfreaks.com/topic/36514-insertatcursor-not-working/#findComment-173990 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 Link to comment https://forums.phpfreaks.com/topic/36514-insertatcursor-not-working/#findComment-174437 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.