JSFiddle - React, Tailwind, and code Playground
HTML
<form onsubmit="return false;">
<input type="text"/>
<input type="submit"/>
</form>
<div class="errors"></div>
JavaScript
$('form').submit(function() {
if ($('input[type=text]').val() == "some_pdf.pdf") {
window.open("http://link_to_some_pdf.com/some_pdf.pdf");
} else if ($('input[type=text]').val() == "some_other_pdf.pdf") {
window.open("http://link_to_some_other_pdf.com/some_other_pdf.pdf");
} else {
alert("Not a valid PDF! Try again!");
}
});