Dynamic object variables

Dynamic object variables

Hi all,

I have an object named "sitedata".  Within it are the followint elements:

  1. sitedata.txt_Forename = '';
  2. sitedata.txt_Surname = '';
...and so on.

I have matching input elements:
  1. <input type="text" id="txt_Forename">
  2. <input type="text" id="txt_Forename">

...and so on.


How do i write a piece of JQuery so that when "txt_Forename" is updated, it modifies "settings.tct_Forename".. and so on for a given set of inouts???  My best (not working) guess so far is:

  1. $(function() {
        $("form#BookerDetails :input[type=text]").keyup(function(){
            settings. + $(this).attr('id') = $(this).val();
            alert(settings. + $(this).attr('id'));
        });
    });




please help!