Skip to content

Instantly share code, notes, and snippets.

@mquan
Created December 5, 2012 19:11
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 mquan/4218591 to your computer and use it in GitHub Desktop.
Save mquan/4218591 to your computer and use it in GitHub Desktop.
comma stuffs
diff --git a/app/views/auction/view_beta.html.erb b/app/views/auction/view_beta.html.erb
index 5a7f8d4..e817565 100644
--- a/app/views/auction/view_beta.html.erb
+++ b/app/views/auction/view_beta.html.erb
@@ -472,6 +472,7 @@
:onclick => "this.value = ''" %>
<% else %>
<%= f.text_field :amount,
+ :data => {:remove_comma => true},
:placeholder => "#{@minimum_bid_amount} or more" %>
<% end %>
</div>
$(document).ready ->
$(document).on 'submit', $("input[data-remove-comma='true']").closest('form'), (e)->
field = $("input[data-remove-comma='true']", $(this))
field.val(field.val().replace(/,/g, ''))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment