Skip to content

Instantly share code, notes, and snippets.

@robroc
Created April 2, 2013 22:19
Show Gist options
  • Save robroc/5296698 to your computer and use it in GitHub Desktop.
Save robroc/5296698 to your computer and use it in GitHub Desktop.
function getStyles(element) {
var $mothertongue = $('#mothertongue'),
$knowledge = $('#knowledge'),
mothertongue = $mothertongue.val(),
knowledge = $knowledge.val();
if (mothertongue == 'NO' || knowledge == 'Both' || knowledge == mothertongue) {
column = 'MT: ' + mothertongue + ', Kn: ' + knowledge;
}
else {
if (element) {
if (element.target.id == 'mothertongue') {
$knowledge.val(mothertongue);
column = 'MT: ' + mothertongue + ', Kn: ' + mothertongue;
}
else if (element.target.id == 'knowledge') {
$mothertongue.val(knowledge);
column = 'MT: ' + knowledge + ', Kn: ' + knowledge;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment