rahulkapoor90/VITacademics-Enhancement-Suite

View on GitHub
Extension for chrome/scripts/VES-API/photo_search.js

Summary

Maintainability
A
0 mins
Test Coverage
$(function () {
    $('#regno').bind("input paste", function () {
        if (this.value.length === 9) {
            updateName(this.value);
        }
    });
    $('#previousBtn').click(function () {
        updateName($('#regno').val());
    });
    $('#nextBtn').click(function () {
        updateName($('#regno').val());
    });
});

function updateName(regno) {
    $.post("https://vtop.vit.ac.in/student/hostel_roommate_eligibility.asp", {
        stdregno: regno,
        btnSub: "submit"
    }, function (data) {
        var name = data.split('<td colspan="2"><b>')[1].split('</b></td>')[0];
        $('#showName').text(name);
    });
}