You can put an onkeyup event handler on the textbox where the numbers are typed in.
In the function that is called with the onkeyup you could grab the current value that is typed in the text field and based on that set the value of your select box.
function grabCardSelection(textNum) {
var selectBoxObj = document.getElementById('objName');
if (String(textNum).substr(0, 1) == '4') {
selectBoxObj.value = "Visa";
//This is assuming your values are named after
//the card names
}
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.