Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8474541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:39:16+00:00 2026-06-10T17:39:16+00:00

I have a form I’m working with that allows the user to continually add

  • 0

I have a form I’m working with that allows the user to continually add new rows as needed (used for making an article with multiple “howto” steps, they can click over and over again to add a new step). What I would like to be able to do is have the user be able to click in any of those rows at any time and then click on a word or button that is off to the side that will then insert the value of that button into the last known cursor position.

So for example I may have one form that currently has 3 rows. If the user goes back and wants to insert some data they could click back in the box and hit the button corresponding to the data they want to insert.

Example input 1: “Remove the customers current IP address and replace with their static IP, [USER COULD CLICK HERE AND THEN CLICK THE STATIC IP BUTTON AND %STATIC_IP% WOULD BE INSERTED AT THE LAST KNOWN CURSOR POSITION (AKA HERE)]

Example input 2: “Enter in the customers [Click to insert %WIFI_SSID%] into the router settings”

I have found several other stackoverflow articles that are able to all insert text but they all expect it to be into a defined textarea or input. In this case I’m needing it to insert into the last known cursor position. I hope this is all clear. I look forward to any assistance or questions.

Starter code: http://jsfiddle.net/4mJwU/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T17:39:17+00:00Added an answer on June 10, 2026 at 5:39 pm

    If you already know how to insert some arbitrary content at the last known caret position, your only problem is to know which field was focues last time before button was clicked.

    That can be done in numerous number of ways, one of those would be utilize focus and blur events (attached to fields – rows in your case) to track (in some variable for example) reference to the field last focused. It should be a piece of cake from there.

    Quick and simple script that can get you started http://jsfiddle.net/sjqWu/1/

    Combine what you’ve learned from other stackoverflow anwsers with example above and you should be ok. Happy learning!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have form, where some fields are looks like rows, so I can add/delete
I have form data that I insert into a database when the user clicks
I' have form that user can select a color. I'm writing that color to
I have form where user submits field. Field can have letters, numbers, and punctuation.
i have form with user data to input and javascript ajax to send information
I have form like this : <div id='add_field' class='locbutton'><a href='#' title='Add'>Add</a></div> <div id='remove_field' class='locbutton2'><a
I have form for file uploading in my website that i check mime-type of
I have form with dateTimeField, and ListView. ListView looks like that: final ListView<String> countryView
I have form object that I set to request in GET request handler in
I have form in VB.Net 2010: I want to click-drag multi rows in dgRegister

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.