javascript onkeyup, onblur, simuating keyboard entry
I am trying to automate entering a betting amount onto a betslip for a bookmaker. The code is as follows:
<input id="slip_sgl_stake95274901L" type ="text"
onblur="document.betslip.single_stake_onblur(this,'95274901L') onkeyup =
"document.betslip.single_stake_onkeyup(this,'95274901L')" size ="7" maxlength="15" value="">
I am using C# and .Net and have tried all sorts but in particular:
wb.Document.All["slip_sgl_stake95274901"L].SetAttribute("value", betAmount + "");
object[] parameters = { wb, spanID.ToString() + "L"};
wb.Document.Invo开发者_如何学编程keScript("document.betslip.single_stake_onkeyup", parameters);
wb.Document.InvokeScript("document.betslip.single_stake_onblur", parameters);
wb is the web browser instance
The amount is entered, but these functions don't seem to work. Any ideas on what I am diong wrong?
It seems that wrong attribute name is used, it must be onblur not onnblur, please check that.
Thanks BHAVIK GOYAL
精彩评论