Skip to content

Instantly share code, notes, and snippets.

Created June 24, 2012 22:22
Show Gist options
  • Save anonymous/2985239 to your computer and use it in GitHub Desktop.
Save anonymous/2985239 to your computer and use it in GitHub Desktop.
<div class="field" id="head_count">
<label for="hard_drive_head_count">Head count</label><br />
<input id="hard_drive_head_count" name="hard_drive[head_count]" type="number" value="0" />
<script type="text/javascript">
document.getElementById("head_count").innerHTML=$(this.children[this.selectedIndex])+ " jjj";
$("#head_count").change(function() {
var selopt = $(this.children[this.selectedIndex]),
isCredit = parseInt(selopt.attr('data-iscredit'));
if (isCredit === 0) {
$("#head_count").hide();
} else {
$("#head_count").show();
}
})
</script>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment