我有三个文本框A,B和C.默认情况下,B文本框被禁用,仅当A中存在某个值时才启用。
当用户在A中输入任何值并按Tab键时,B按预期启用,但由于制表符而导致的流量传输到C而不是B.
function enableOrDisableTaxThresholdAmount(elm,taxThresholdAmountField){
if($(elm).val() != "") {
$(elm).closest('.fieldRowtest').find('[name="'+B+'"]').prop('disabled',false).removeClass('editboxdisabled');
} else {
$(elm).closest('.fieldRowtest').find('[name="'+B+'"]').val('').prop('disabled',true).addClass('editboxdisabled');
}
}
答案 0 :(得分:1)
尝试jquery .focus(),例如你可以重载[Tab]按钮点击:
WebElement Billing = Driver. findElement(By.xpath("//li[@class='menuCog' and contains(text(), 'Billing')]"));
Actions builder = new Actions(Driver);
builder.moveToElement(Billing).click().build().perform();
WebElement ViewBill = Driver.findElement(By.xpath("//a[@class='menuCog' and href='/business/controlcenter/billing/invoices/view-bill']"));
builder.moveToElement(ViewBill).click().build().perform();