Click() doesn't activate.

Click() doesn't activate.

I've made this script to change attributes of a form.

  1. <script type="text/javascript">
    $
    ("#name_$gId").click(function() {
    $
    (function() {
    $
    ('[name=debtForm]').get('debtForm').setAttribute('action', 'scms_actions.php?id=$_GET[id]&what=debt&do=edit&which=$editWhich');
    $
    ('[name=debtName]').val('$gName');
    $
    ('[name=debtAmount]').val('$gAmount');

    $

    ('[name=withdrawDeposit]').attr('readonly', false);
    $
    ('[name=debtName]').attr('readonly', true);
    });
    });
    </script> 



But it doesn't do anything. I've tried putting in an alert() to see if the script reacted at all, but it didn't.
Can anyone help me make this script work?