Simple Javascript to insert text into form field at curser
$30-100 USD
Complété
Publié il y a environ 14 ans
$30-100 USD
Payé lors de la livraison
I want some javascript that allows a user to click on a word (or? sentence) and that word(or? sentence)? will then be inserted into a form field where the caret/cursor? is. Similar to? <[login to view URL]> [][1]But with two important? differences
1) that the text will be inserted in the field the user is click in (this example script on works for a specific form field)
2) That the cursor return to the end of the inserted text (so the user can keep typing without clicking again, or click on another word)
## Deliverables
Please provide a working? example? of a html file with a form with
text and textarea fields
An example test page should include something like this (square brackets show a test or textarea field on a form)
field 1: [ ? ? ? ? ? ? ]
field 2: [ ? ? ? ? ? ? ]
field 3: [ ? ? ? ? ? ? ]
field 4: [ ? ? ? ? ? ? ]
List of sample text to click on (and insert)
dog
tree
cat
a frog eating a fly
a letter and the number 5
test 1) click in field 1, type "a ", click on 'dog', type " jumped over the ", click on 'tree' ? (note that there is no clicking back in the field after the initial click)
Result 1) the phrase "a dog jumped over the tree" is now displayed in field 1 and the cursor is sitting at the end of the field.
Test 2) click in field 3 then click on 'a frog eating a fly'.
Result) the phrase "a frog eating a fly"? is displayed in field 3 and the cursor is sitting at the end of the field (after "fly")
Test 3) click back into field 1 (at the end of the previous phrase from test 1) then click on 'a letter and the number 5'.
Result 1) the phrase "a dog jumped over the treea letter and the number 5" is displayed in field 1 and the cursor sitting at the end of the field.
| ? |