Last active
September 9, 2016 18:46
-
-
Save lscoates/46ee0160e2af3bf828d891a6b5dbb81c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
var organizationLabel = $('label[for="subscription_customer_attributes_organization"]'); | |
organizationLabel.text(organizationLabel.text() + " *"); | |
}); | |
var form = $("#signup-form"); | |
var organization = $("#subscription_customer_attributes_organization"); | |
var submitBtn = $("#subscription_submit") | |
submitBtn.click(function() { | |
if (organization.val() === "") { | |
organization.addClass("field-error"); | |
return false; | |
} | |
}); | |
form.change(function(){ | |
if (organization.val() != "") { | |
submitBtn.click(function() { | |
return true; | |
}); | |
} | |
}); | |
$("#subscription_customer_attributes_organization").blur(function() { | |
if ($(this).val() !== "") { | |
$(this).removeClass("field-error"); | |
} else { | |
$(this).addClass("field-error"); | |
} | |
}); | |
.field-error { | |
border-color: #ff0000; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment