JSFiddle - React, Tailwind, and code Playground
HTML
<select id="myDropdown">
<option value="number">Number</option>
<option value="text">Text</option>
<option value="float">Float</option>
</select>
<input type="text" id="myInput" value="" />
JavaScript
$("#myInput").on("keydown", function(e) {
var dropdown = $("#myDropdown").val();
var inputValue = $(this).val();
if(dropdown === "number") {
//"Do your number validation here
} else if(dropdown === "text") {
//Do your text validation here
} else if(dropdown === "float") {
//Do your float validation here
}
});