Question: I am trying to get the `id` of an `input field` which has a dynamic id but I get an error unrecognized expression. Below is my code : 

```
  $("#amount_paid' + data[i].patient_visit_statement_id + '").keyup(function() {
       var amount_owed = $('#amount_owed' + data[i].patient_visit_statement_id + '').val();
       var amount_paid = $('#amount_paid' + data[i].patient_visit_statement_id + '').val();
       alert('Amount owed' + amount_owed + 'Amount paid' + amount_paid + '');
       if (amount_owed < amount_paid) {
           alert('Amount to be paid exceeds amount owed');
       }
   });

```

What is the best way to get the value from the id amount\_paid which has dynamic id for each entry ?

Answer: 
**This is a response to the initial question - ignore this.**

When you "box" a nullable value (so you put it in an `object`), it is transformed in its underlying type (`bool` in your case) or in `null`... So if you have

```
bool? value = true;
object value2 = value; 

```

now `value2.GetType() == typeof(bool)`
Try this

```
List<string> values = typeof(InstViewModel).GetProperties()
    .Select(prop => new { N = prop.Name, T = prop.PropertyType, V = prop.GetValue(ivm, null) })
    .Where(prop => prop.N != "SubCollection" && prop.N != "ID" && prop.N != "Name" && prop.N != "Level")
    .Where(val => (val.V != null && val.T.IsAssignableFrom(typeof(Nullable<bool>))) || Convert.ToBoolean(val.V))                    
    .Select(val => val.V.ToString())
    .Where(str => str.Length > 0)
    .ToList();

```