Jump to content

Find Mouse Location In A Textarea


siberneil

Recommended Posts

I am looking for code that will help locate where a user clicks inside a textarea. I only need to identify which row the user clicks in. I would like to highlight the entire line and then bring the information from that line back into the form fields for the user to edit. The information is ended by '\n' so I can search for that to create the selection area. And I already have the data in an array, so the info is in the format that I need it to be. I do not want the user to edit the textarea directly so I have it set as readonly.Any suggestions?

Link to comment
Share on other sites

I think you actually want something like this:

<select size="5" id="options">  <option value="1">First option</option>  <option value="2">Second option</option>  <option value="3">Third option</option>  <option value="4">Fourth option</option>  <option value="5">Fifth option</option></select>

Later on, you can get the selected option through Javascript and use it however you like.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...