Jump to content

insertAtCursor not working


Buttero

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.