How to focus next field if user clicked on the link?
- by LA_
I have a number of fields with labels-links like below:
<div class="control-group">
<label class="control-label" for="some-id-1"><a href="http://example.com/some-id-1" target="_blank">Text1</a></label>
<div class="controls">
<input type="text" id="some-id-1" name="some-id-1"><br>
</div>
</div>
<div class="control-group">
<label class="control-label" for="some-id-2"><a href="http://example.com/some-id-2" target="_blank">Text2</a></label>
<div class="controls">
<input type="text" id="some-id-2" name="some-id-2"><br>
</div>
</div>
If user clicks on the link, how can I focus according field (without preventing default action)? I.e. if user clicks on Text1, then I should open http://example.com/some-id-1 in new window and set focus at input with id some-id-1.