Advert
Search the Community
Showing results for tags '_ieheadinserteventscript'.
-
I have an IE form for patients to request medication refills on-line. The problem is that after submitting the form, the patient doesn’t get a list of medications s/he requested. I tried with _IEHeadInsertEventScript to call a function that reads the form’s text boxes, but all I could get is a message (“alert”) about leaving the page. I did not find any documentation to call a function or even get a msgbox that would call the function when clicked. This is my code: #include <IE.au3> #include <Array.au3> Local $avTheDrugs[8] $oIE = _IEAttach ("Order Refill Request Form: Pharmacy Services, University Hospital") $oForm = _IEFormGetObjByName ($oIE, 'Refill_Request_Form') _IEHeadInsertEventScript ($oIE, "window", "onbeforeunload", _ "alert('Example warning follows...');return 'Pending changes may be lost';") Func GetDrugName() $oDrug1 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_1") _ArrayInsert($avTheDrugs,0,_IEFormElementGetValue ($oDrug1)) $oDrug2 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_2") _ArrayInsert($avTheDrugs,1,_IEFormElementGetValue ($oDrug2)) $oDrug3 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_3") _ArrayInsert($avTheDrugs,2,_IEFormElementGetValue ($oDrug3)) $oDrug4 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_4") _ArrayInsert($avTheDrugs,3,_IEFormElementGetValue ($oDrug4)) $oDrug5 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_5") _ArrayInsert($avTheDrugs,4,_IEFormElementGetValue ($oDrug5)) $oDrug6 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_6") _ArrayInsert($avTheDrugs,5,_IEFormElementGetValue ($oDrug6)) $oDrug7 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_7") _ArrayInsert($avTheDrugs,7,_IEFormElementGetValue ($oDrug7)) $oDrug8 = _IEFormElementGetObjByName ($oForm, "rx_name_strength_8") _ArrayInsert($avTheDrugs,8,_IEFormElementGetValue ($oDrug8)) ;Remove blanks For $n = UBound($avTheDrugs) - 1 To 0 Step -1 If StringStripWS($avTheDrugs[$n], 8) = "" Then _ArrayDelete($avTheDrugs, $n) EndIf Next EndFunc _ArrayDisplay($avTheDrugs,"The drugs") Thanks for your help.