Bootstrap按钮 - 无线电值未设置

I am using twitter bootstrap button radio and i have a question on a php form that looks like this.

enter image description here

the HTML part of code is as following

<div class="control-group" style="background-color: #d9d9d9;">
    <label style="font-size: 10px; width: 250px; padding-left: 10px" class="control-label"
           for="fname"><?php _e('Does your employer contribute extra super above the 9.25% guarantee?'); ?>
    </label>

    <div class="controls">
        <div data-toggle="buttons-radio" class="btn-group alignment"
             style="padding-top: 10px; padding-left: 10px">
            <button id="yes" class="btn btn-primary btn-mini <?php if ($budget->getFactFind('employer_contribution') == "Yes"){?> active <?php } ?> " type="button" value="yes"
                    onclick="showEmployerDiv(this.id)">Yes
            </button>
            <button id="no" class="btn btn-primary btn-mini <?php if ($budget->getFactFind('employer_contribution') == "No"){?> active <?php } ?> " type="button" value="no"
                    onclick="showEmployerDiv(this.id)">No
            </button>
        </div>
        <input type="hidden" id="alignment" value="" name="employer_contribution"/>

    </div>
</div>

and the JS that plays to role of checking which option is selected is as following

$(".alignment .btn").click(function () {
    // whenever a button is clicked, set the hidden helper employer controbution
    $("#alignment").val($(this).text());
});

I am able to get the value of which option is selected on form submission and I am also able to mark the option as selected when the user returns in future to show them what option did they select previously.

Each time the form is submitted there is an UPDATE query that updates the information in MySQL. Please note that this is not the only field on form.

The problem I am having is if suppose the user already provided the answer (Yes) and comes back later on but this time he leaves the answer selected as yes and clicks on the submit button it is here the JS fails to see what option is selected and the previously provided answer Yes gets overwritten by nothing (null value).

The JS works if i click the already answered yes value but not if i leave it as it is, now i know that i am using .click in JS and I needed help in knowing what else to use other than .click to fix this problem.

I will really appreciate any assistance

Finally managed to do it by using $(document).ready(function (), this way my .click functions do not get disturbed also, now if the user already provided the answer, its value gets submitted as well and if the users wants to change the answer the .click will take care of it.

$(document).ready(function () {
    document.getElementById('alignment').value='<?php echo $budget->getFactFind('employer_contribution')?>' ;
});

How do you check if the user has previously clicked the button?

If you check the answer with php, you can do something like this:

Lets suppose that you're holding the user's choice in the variable $choice ....

 <input type="hidden" id="alignment" value="<?php echo $choice ?>" name="employer_contribution"/>