I have this append script that adds in a set of field on my form. Based on the appended field, I would like for the "upg" select field to ONLY display if the valus for "status" is "Actual". This condition should be applicable to all the appended field set so that if status1 is Actual I have a upg field but is status2 is Ghost, upg2 field should be hidden and so on. What do you guys suggest as the best way to do this?
<script type="text/javascript">
var count = 0;
$(function(){
$('a#add_field').click(function(){
count += 1;
$('#activation').append(
'<div class="row-fluid">'
+'<div class="span12" style="border-bottom:1px #dddddd; background-color:#e8e8e8; ">'
+'<div style="float:left; width:7%;">'
+'<label> </label>'
+'<select name="status' + count + '" id="status' + count + '" class="input-small">'
+'<option value="Ghost">Ghost</option>'
+'<option value="Actual">Actual</option>'
+'</select>'
+'</div>'
+'<div style="float:left; width: 7%">'
+'<label>Type</label>'
+'<select id="upg' + count + '" name="upg' + count + '" class="input-small" >'
+'<option value="" selected=" " > </option>'
+'<option value="Exp" >Exp</option>'
+'<option value="Post" >Post</option>'
+'<option value="Upgrade" >Upg</option>'
+'<option value="Retail" >Retail</option>'
+'</select>'
+'</div>'
);
});
});