I’m really not sure whats going on here. In a script I’m asking for input. If I swipe my gift card it returns, but if I just type it in “Manual Input” it returns nothing. I’ve tried a few different ways, but nothing seems to work. What am I missing?
function swipe() {
var card = dlg.EditValue("Swipe Gift Card;;;ONC","");
var check = card.substring(2,2);
var card_number = "";
if (check = "B") {
return card_number = card.substring(card.lastIndexOf("B")+1, card.lastIndexOf("^"));
} else {
return card;
}
}
Not sure how I missed that. Its been a long day. It wasn’t making it into the else statement and the blank was a result of the invalid index since the typed number didn’t contain the proper index characters.