Skip to content

Instantly share code, notes, and snippets.

@kellysutton
Created August 19, 2011 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kellysutton/1157320 to your computer and use it in GitHub Desktop.
Save kellysutton/1157320 to your computer and use it in GitHub Desktop.
HTML5 Forms
<style>
.ProFeature {
display: none;
}
</style>
<form action="/episodes" method="POST" data-is-pro="<%= user.pro %>">
<input type="email" name="email" />
<input type="email" name="alternate_email" class="ProFeature" disabled />
</form>
<script>
var proFeatures;
if ($('form').data('is-pro')) {
proFeatures = $('.ProFeature');
proFeatures.prop('disabled', false);
proFeatures.show();
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment