title: JSON retrieving object via variable name
body: <p>I've created a .post form that returns a JSON string and I need to get the data based on the name of the select boxes. please refer to the following example.</p>
  
  <p>JavaScript</p>
  
  <pre><code>$(document).ready(function(){
      $.post('/seller/product_upload/helpers/jpost_product_form_autofill.php',{product_id:$("input[name='product_id']").val()},function(data){
          alert(data);
          if(data!='false'){
              var obj = jQuery.parseJSON(data);
              $("#attributes_table select").each(function(){
                  var select=$(this);
                  select.find("option").each(function(){
                      var option=$(this);
                      var select_name=select.attr('name');
                      alert(select_name);
                      alert(obj.select_name);
                      if(option.val()==obj.select_name){
                          option.attr('selected','selected');
                      }
                  });
              });
          }
      });
  });     
  </code></pre>
  
  <p>The main section of concern here is actually the bottom <code>if</code> part. <code>obj.select_name</code> is not the main object name here. It is actually the name of the <code>selectbox</code> which I had made it coincidental to my array key values parsed in JSON. </p>
  
  <p>But now the system keeps alerting undefined for <code>obj.select_name</code>. Is there any way in which i can parse select_name as a string first before having it parsed as a JSON object?</p>