Web Form [Radio Button]

Get help with using AutoHotkey and its commands and hotkeys
kaashif
Posts: 2
Joined: 15 Dec 2018, 21:23

Web Form [Radio Button]

12 Jan 2019, 12:26

Hi All,
I am trying to fill in a webform using AutoHotKey.
1. How do i change the item on drop-down list? By default, it's selected to "Smart office suite". I need to select "Smart office suite -Web"
2. How do it change the item on the radio button field. By default, it is selected to "MS Access". I need to select "SQL Server"

Here's the link to the webform: http://www.so365.in/elicense/elicense.aspx

A forum member help me with a code to fill in the webform and do few other tasks. https://www.autohotkey.com/boards/viewt ... 76&t=60020

Appreciate if someone can modify the old one and provide the new one.

Thanks!
User avatar
TheDewd
Posts: 1190
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Web Form [Radio Button]

14 Jan 2019, 10:17

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

F11::
Data:= { "ctl00$MainContent$txt_company":"Val Technologies", "ctl00$MainContent$txt_Location":"Dubai", "ctl00$MainContent$txt_ActivationCode":"00111726908643","ctl00$MainContent$email":"kaashif@grr.la","ctl00$MainContent$phone":"22254123", "ctl00$MainContent$drp_Software":"Smart office suite-Web"}
url:="http://www.so365.in/elicense/elicense.aspx"  ;example form
urltab:="OneSpaWorld.com"

wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := true

wb.Navigate(url)

while wb.readyState!=4 || wb.document.readyState != "complete" || wb.busy
	sleep 10

for Field, Value in Data
{
	wb.document.all[Field].value := Value
	Sleep, 100
}

wb.document.getElementByID["MainContent_rbtlst_DatabaseType_1"].Click()

wb.document.getElementByID("ctl00$MainContent$btn_SendMail").Click()
Loop % (input := wb.document.getElementsByTagName("input")).length	;-->loop through all input tags and click on any that contain the specifie value
	if (InStr(input[A_Index-1].value,"send")){
		input[A_Index-1].click()
		break
	}

sleep 5000
SoundBeep
;wb.quit
;wb:=""
;^The Above should work, but i find this is more reliable....
HWND := wb.hwnd
WinGet PID, PID, ahk_id %HWND%
Process, Close, % PID
return
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 35 guests