wackywoo105
Registered User.
- Local time
- Today, 06:35
- Joined
- Mar 14, 2014
- Messages
- 203
I’m trying to complete a form where some elements are locked until others have been completed. When doing this manually just the act of typing something into the required fields unlocks the corresponding controls.
For some reason entering the data like this doesn’t unlock the locked field:
So, I’ve tried sendkeys, which works but is messy and runs the risk the user clicks another window before it executes:
I also tried :
After all data has been entered into unlocked boxes, but it doesn’t work.
Can anyone help me unlock these controls? The green arrows show the controls and what they unlock, which I have included in the locked and unlocked states. I've put the html for the fields below.
+/- while locked
CYL
+/- after unlocked
Reading Voucher Type while locked
Add
Reading Voucher Type after unlocked
For some reason entering the data like this doesn’t unlock the locked field:
Code:
IE.Document.getElementById("txtPrescriptionRightDistanceCyl").Value = Right(RECyl, 5)
So, I’ve tried sendkeys, which works but is messy and runs the risk the user clicks another window before it executes:
Code:
IE.Document.getElementById("txtPrescriptionRightDistanceCyl").Select
SendKeys "{ENTER}", True
I also tried :
Code:
IE.Document.parentWindow.execScript "OnChangeEvent(this)"
Can anyone help me unlock these controls? The green arrows show the controls and what they unlock, which I have included in the locked and unlocked states. I've put the html for the fields below.
+/- while locked
Code:
<input name="outcomemodel.PMPrescriptionRightDistanceCyl" disabled="disabled" class="form-control margin-left-10 w38 text-box single-line" id="txtPMPrescriptionRightDistanceCyl" type="text" maxlength="1" placeholder="+/-" value="" autocomplete="off">
CYL
Code:
<input name="outcomemodel.PrescriptionRightDistanceCyl" class="form-control w68 margin-left-5 text-box single-line" id="txtPrescriptionRightDistanceCyl" onchange="OnChangeEvent(this)" type="text" maxlength="5" placeholder="00.00" value="" autocomplete="off" data-val="true" data-val-number="The field PrescriptionRightDistanceCyl must be a number.">
+/- after unlocked
Code:
<input name="outcomemodel.PMPrescriptionRightDistanceCyl" class="form-control margin-left-10 w38 text-box single-line" id="txtPMPrescriptionRightDistanceCyl" type="text" maxlength="1" placeholder="+/-" value="" autocomplete="off">
Reading Voucher Type while locked
Code:
<select name="outcomemodel.SecondVoucherTypeCode" disabled="" class="form-control" id="outcomemodel_SecondVoucherTypeCode"><option value="0">Please Select</option>
<option value="920000650">A</option>
<option value="920000651">B</option>
<option value="920000652">C</option>
<option value="920000653">D</option>
</select>
Add
Code:
<input name="outcomemodel.PrescriptionRightNearSph" class="form-control w68 margin-left-5 margin-left-18 ipad-radio-btn-margin text-box single-line" id="txtPrescriptionRightNearSph" onchange="OnChangeEvent(this)" type="text" maxlength="5" placeholder="00.00" value="" autocomplete="off" data-val="true" data-val-number="The field PrescriptionRightNearSph must be a number.">
Reading Voucher Type after unlocked
Code:
<select name="outcomemodel.SecondVoucherTypeCode" class="form-control" id="outcomemodel_SecondVoucherTypeCode"><option value="0">Please Select</option>
<option value="920000650">A</option>
<option value="920000651">B</option>
<option value="920000652">C</option>
<option value="920000653">D</option>
</select>
Last edited: