WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with MSIE
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Check a Checkbox When They All Have the Same Name


Question:

I can't seem to select any of the check boxes in the attached Fed Ex webpage. I've worked with check boxes before successfully, but this one stumped me. My goal is to select one of the check boxes left of any of the ship dates and then press the button "view shipment details". Could you guys see if you can help me figure out how to do this one?

I need is to select one of the check boxes next to the actual shipped items. All of the check boxes are named "record" - so I'm not sure how to identify them...

Answer:

Pass the item number instead of the name :
objCheckbox = oIE.Document.Body.GetElementsByTagName("INPUT").Item(20)
OR
Winbatch Version: 2005C -- Script By Jay Alverson
;   same principle, just retrieve the elements named "record"

CKBoxColl = browser.document.GetElementsByName("record")

CKNameList = ""

ForEach CKBox In CKBoxColl
   If CKBox.type == "checkbox" Then CKNameList = ItemInsert(CKBox.name, -1, CKNameList, @LF)
Next

CKBoxColl.item(1).checked = 1   ;<-- check the 2nd item in a zero based subscript collection...

Message("Debug", CKNameList)

Article ID:   W17177
File Created: 2007:07:03:14:28:36
Last Updated: 2007:07:03:14:28:36