use
$("#location1_update").hide()
and
$("#location1_update").show()
for hide and show the button. change this html whit id instead name
<input class="submit-button" type="submit" id="location1_update" value="Update">
<input class="submit-button" type="submit" id="location2_update" value="Update">
then the js could be
if (id == '1') {
$('#tr_1').css('display', 'table-row');
$('#tr_2').css('display', 'none');
$("#location1_update").show();
$("#location2_update").hide();
}
if (id == '2') {
$('#tr_2').css('display', 'table-row');
$('#tr_1').css('display', 'none');
$("#location2_update").show();
$("#location1_update").hide();
}