Jump to content
Dent

[SOLVED] form not recognising input upon submit

Recommended Posts

Dent

Hey,

So I've written this code which successfully populates a form but when 'Calculate' is clicked it says that the loan amount & purchase price need to be entered; which of course they have been. Any idea why?

Here's the form https://online.leedsbuildingsociety.co.uk/public/mortgages/quick_enquiry.do

Here's the code:-

Local $oIE = _IECreate("https://online.leedsbuildingsociety.co.uk/public/mortgages/quick_enquiry.do")
If Not IsObj($oIE) Then Exit ConsoleWrite("Error in $oIE" & @CRLF)

Local $oIE = _IEAttach("Leeds Building Society - Borrowing Calculator")

_IELoadWait($oIE)

$oSelect = _IEGetObjByName($oIE, "termYears")
$oSelect.Value = $MtgTermYrs
$oSelect = _IEGetObjByName($oIE, "termMonths")
$oSelect.Value = $MtgTermMths

$oSelect = _IEGetObjByName($oIE, "adults17Over")
$oSelect.Value = ($NumOfApplicants + $OtherAdultOccupants)

Local $TotalDependents = ($Deps10To5 + $Deps16To11 + $Deps112To17 + $Deps20To5 + $Deps26To11 + $Deps212To17)

If $TotalDependents > 0 Then
   $oSelect = _IEGetObjByName($oIE, "childrenUnder17")
   $oSelect.Value = $TotalDependents
Else
EndIf

$Blah2 = ($MonthlyPensionIncomeOne + $MonthlyPensionCreditIncomeOne + $MonthlyInvestmentIncomeOne)
$Blah2 = $Blah2 * 12
$oSelect = _IEGetObjByName($oIE, "applicantOneGrossIncome")
$oSelect.Value = ($SalaryOne + $Blah2 + $SalaryPlusDividendsLatestYrOne)
$oSelect = _IEGetObjByName($oIE, "applicantOneCommission")
$Blah1 = (($BonusOne + $OvertimeOne + $CommissionOne) + ($MonthlyMaintenanceIncomeOne * 12))
$oSelect.Value = $Blah1
$oSelect = _IEGetObjByName($oIE, "applicantOneOvertimeOrBonus")
$oSelect.Value = ($MonthlyUniversalTaxCreditIncomeOne * 12)

$Blah2 = ($MonthlyPensionIncomeTwo + $MonthlyPensionCreditIncomeTwo + $MonthlyInvestmentIncomeTwo)
$Blah2 = $Blah2 * 12
$oSelect = _IEGetObjByName($oIE, "applicantTwoGrossIncome")
$oSelect.Value = ($SalaryTwo + $Blah2 + $SalaryPlusDividendsLatestYrTwo)
$oSelect = _IEGetObjByName($oIE, "applicantTwoCommission")
$Blah1 = (($BonusTwo + $OvertimeTwo + $CommissionTwo) + ($MonthlyMaintenanceIncomeTwo * 12))
$oSelect.Value = $Blah1
$oSelect = _IEGetObjByName($oIE, "applicantTwoOvertimeOrBonus")
$oSelect.Value = ($MonthlyUniversalTaxCreditIncomeTwo * 12)

$oSelect = _IEGetObjByName($oIE, "applicantOneLastYearProfit")
$oSelect.Value = ($NetPreTaxProfitLatestYrOne + $ShareOfNetPreTaxProfitLatestYrOne)
$oSelect = _IEGetObjByName($oIE, "applicantOneYear2Profit")
$oSelect.Value = ($NetPreTaxProfitPrevYrOne + $ShareOfNetPreTaxProfitPrevYrOne)

$oSelect = _IEGetObjByName($oIE, "applicantTwoLastYearProfit")
$oSelect.Value = ($NetPreTaxProfitLatestYrTwo + $ShareOfNetPreTaxProfitLatestYrTwo)
$oSelect = _IEGetObjByName($oIE, "applicantTwoYear2Profit")
$oSelect.Value = ($NetPreTaxProfitPrevYrTwo + $ShareOfNetPreTaxProfitPrevYrTwo)

$PropertyValue = _IEGetObjByName($oIE, "purchasePriceValuation")
$PropertyValue.Value = $PP

$MortgageRequired = _IEGetObjByName($oIE, "repaymentAmount")
$MortgageRequired.Value = $MtgAmt

$oSelect = _IEGetObjByName($oIE, "interestOnlyAmount")
$oSelect.Value = 0

$Button = _IEGetObjByName($oIE, "calculateBtn.value")
_IEAction($Button, "click")

_IELoadWait($oIE)

Exit

Obviously I've got values stored in all the variables so I haven't posted all that code.

Edited by Dent
solved

Share this post


Link to post
Share on other sites
Dent

Thanks Danp2, I'll give that a try.

Share this post


Link to post
Share on other sites
Dent

That has worked perfectly. Thank-you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • SkysLastChance
      By SkysLastChance
      I am having a hard time understanding why this is not working. I was hoping some one could help explain it to me. 
      $tags = $oIE.document.GetElementsByTagName("input") For $tag in $tags $class_value = $tag.GetAttribute("class") If string($class_value) = "fTs-p3298-l0 wplEditControl" Then $target = $tag ExitLoop EndIF Next MsgBox(0,"",$target) If $target = "fTs-p3298-l0 wplEditControl" THEN MsgBox(0,"","itworked") I have tried 
       MsgBox(0,"",$target.Attribute)  MsgBox(0,"",$target.Value)  MsgBox(0,"",$target.InnerText) I would expect to see this in the msgbox
      fTs-p3298-l0 wplEditControl  
    • SkysLastChance
      By SkysLastChance
      I am trying to grab the id "in2xk_26" however it the characters before the underscore always change. (in the name too)
      Is there a way I can find a id or name by the last 3 charcters?
      Using something like "stringright?"
      So I would want to search for just "_26" in this case.
      This is assuming that there are no other _26
       

      #include <Excel.au3> #include <IE.au3> #include <GUIConstantsEx.au3> Global $iMousespeed = 25,$target = "",$TagName = "",$Value = "",$Atrribute = "" $oIE = _IEAttach("MEDITECH") $TagName = "input" $Value = "in2xk_26" $Attribute = "id" $tags = $oIE.document.GetElementsByTagName($TagName) ;TagName ------ MAKE SURE TO NAME THESE For $tag in $tags $class_value = $tag.GetAttribute($Attribute) ;Attribute ------ MAKE SURE TO NAME THESE If string($class_value) = $Value Then ;Value ------ MAKE SURE TO NAME THESE $target = $tag $iScreenX = _IEPropertyGet($target, "screenx") $iScreenY = _IEPropertyGet($target, "screeny") $iWidth = _IEPropertyGet($target, "width") $iHeight = _IEPropertyGet($target, "height") $oMouseCords = MouseMove($iScreenX + $iWidth / 2, $iScreenY + $iHeight / 2, $iMousespeed) MouseClick($MOUSE_CLICK_LEFT) ExitLoop EndIf Next  
       
    • SkysLastChance
      By SkysLastChance
      I was wondering how I read data inside of a iframe. I would like to be able to click something inside a iframe. However, I can't even find the tag. 
      The id and name change all the time so I can't use those. 
      The code highlighted in blue is what I am trying to click. (second picture)
      Here is what I have tried.
      $target = "" $tags = $oIE.document.GetElementsByTagName("div") For $tag in $tags $class_value = $tag.GetAttribute("class") If string($class_value) = "s_92 altstyle s_93 s_94" Then $target = $tag ConsoleWrite("Tag Found " & $target.outerText&@CRLF) ExitLoop EndIf Next  

       
       

    • SkysLastChance
      By SkysLastChance
       
      WinActivate("MEDITECH - Internet Explorer") Sleep (500) $oIE = _IEAttach("MEDITECH") $oDiv1 = _IEGetObjById($oIE, "sysmenu-searchbarbutton") _IEAction($oDiv1, "click") I am just trying to click the little magnifying glass, next to the gear button with no luck. I was hoping someone might have an idea why this is not working?
       

    • SkysLastChance
      By SkysLastChance
      I am trying to type a name in patient summary search box. How should I go about doing this. I am clearly not doing it right. (Attached Picture of HTML code.)
      This is what I have tried. I assume this is not working because it is not a form? 
      WinActivate("MEDITECH - Internet Explorer")       Sleep (500)    $oIE = _IEAttach("MEDITECH")    $oForm = _IEFormGetObjByName($oIE, "systemMenu")    $oText = _IEFormElementGetObjByName($oForm, "sysmenu-searchbarinput") _IEFormElementSetValue($oText, "Hey! This works!")
×