Skip to content

Instantly share code, notes, and snippets.

@dorukcan
Last active September 11, 2017 06:42
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 dorukcan/f7ac2fbd6df2951f8285 to your computer and use it in GitHub Desktop.
Save dorukcan/f7ac2fbd6df2951f8285 to your computer and use it in GitHub Desktop.
var COURSES = [
["EC", "101", "09", "N", null],
["TK", "221", "51", "C", null],
["LIT", "211", "02", "N", null],
["MATH", "102", "01", "N", "MATH102 F"],
["PHYS", "102", "01", "N", "PHYS102 F"],
["FA", "48P", "01", "N", "PHYS125 F"],
];
for (i = 0; i < COURSES.length; i++) {
$('*[name="abbr' + (i + 1) + '"]').val( COURSES[i][0] );
$('*[name="code' + (i + 1) + '"]').val( COURSES[i][1] );
$('*[name="section' + (i + 1) + '"]').val( COURSES[i][2] );
$('*[name="rnc' + (i + 1) + '"]').filter(function() {
return $(this).attr('value') == COURSES[i][3]
}).prop("checked", true);
$('*[name="rcourse' + (i + 1) + '"]').val( COURSES[i][4] );
}
$(".formc[value='Quick Add'").focus();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment