You could just add a custom attribute:
<input id="txtStreetNumber" name="txtStreetNumber" type="text" data-tab="tabGeneral" />
Now you have a relationship, what you do with that relationship is up to you.
example using jQuery:
$(function(){
$('#txtStreetNumber').click(function(){
var tabId = $(this).attr('data-tab');
alert(tabId);
alert($('#' + tabId).is('checked'));
});
});
stbuchok
Practically a Posting Shark
876 posts since May 2011
Reputation Points: 138
Solved Threads: 124
Skill Endorsements: 2
Why can you use JavaScript and not jQuery?
You should be able to use this as well (just a starting point, not a full solution).
var element = document.getElementById('textboxId');
var tabId = element.getAttribute('data-tab');
tab = document.getElementById(tabId);
basically, it'd probably look something like this (place code at bottom of page in script tags, just above </body>):
var textBox = document.getElementById('textBoxId');
textBox.click = function(){
var tabId = this.getAttribute('data-tab');
tab = document.getElementById(tabId);
//now you do whatever you need to with tab
};
Please remember, not tested in any way shape or form. ;)
stbuchok
Practically a Posting Shark
876 posts since May 2011
Reputation Points: 138
Solved Threads: 124
Skill Endorsements: 2