|
<script>
$(function () {
var wait = 0;
//Do a lookup to see if the hashtag is taken, and if so, let the user know
//Helpful to do it dynamically rather than the user having to wait till they submit the form to find out...
$("#HashTag").keyup(function () {
var hashtag = $("#HashTag").val();
clearTimeout(wait);
//Wait a second in case the user keeps typing before doing the lookup
wait = setTimeout(function () {
var url = '@Url.Action("Lookup", "Conference")?conferenceHashTag=' + hashtag;
$.getJSON(url, function (isAvailable) {
var validator = $("#main-content form").validate();
if (!isAvailable === true) {
validator.showErrors({ "HashTag": "Unfortunately that hashtag is not available." });
$('.tooltip').hide();
}
});
}, 1000);
});
});
</script>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm a software developer based in the beautiful city of Wellington, New Zealand. I love experimenting with new .Net technologies as they arrive, and these days there seems to be a lot of choice as there are so many new features in the framework! My current interests are Azure, ASP.Net MVC, SignalR, Knockout, AngularJS, and responsive design (inc. using Bootstrap, Foundation, Skeleton). These change fairly often as I tinker with various new technologies...