Skip to content

Instantly share code, notes, and snippets.

@chadoh
Created September 27, 2012 19:17
Show Gist options
  • Select an option

  • Save chadoh/3795866 to your computer and use it in GitHub Desktop.

Select an option

Save chadoh/3795866 to your computer and use it in GitHub Desktop.
$(function(){
/* currency converter */
$('#link-currency').click(function(e){
e.preventDefault();
$('#popup-currency').toggleClass('active');
});
/* add style to form when input is highlighted */
$('#bid_amount').focus(function(){ $('form#new_bid').addClass('focused'); });
$('#bid_amount').blur( function(){ $('form#new_bid').removeClass('focused'); });
/* focus the form (for browsers that don't support autofocus) */
$('#bid_amount').focus();
/* form validation */
$('#new_bid').validate({
rules: {
bid_amount: {
required: true,
number: true,
min: 10
}
},
errorLabelContainer: '#inlineErrors',
onkeyup: false,
onfocusout: false,
onclick: false,
debug: true
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment