Let me start by saying I am a noob in javascript.
I was working with a webpage manipulating some items from B4J, and this https://www.b4x.com/android/forum/t...es-of-an-html-form-in-a-webview-object.47072/ thread helped me and I am now in the final stage.
The last page after login has multiple checkboxes with classes. The SUBMIT button is disabled until one checkbox is clicked, and the button becomes active.
There is this javascript on the page.
These are my tries failed attempts.
I was working with a webpage manipulating some items from B4J, and this https://www.b4x.com/android/forum/t...es-of-an-html-form-in-a-webview-object.47072/ thread helped me and I am now in the final stage.
The last page after login has multiple checkboxes with classes. The SUBMIT button is disabled until one checkbox is clicked, and the button becomes active.
HTML:
<label class="customcheck">Select
<input type="checkbox" class="check" name="nominee" value="47">
<span class="checkmark"></span>
</label>
<label class="customcheck">Select
<input type="checkbox" class="check" name="nominee" value="48">
<span class="checkmark"></span>
</label>
There is this javascript on the page.
JavaScript:
<script type="text/javascript">
$(document).ready(function(){
$('.check').click(function() {
$('.check').not(this).prop('checked', false);
});
var checkboxes = $("input[type='checkbox']"),
submitButt = $("input[type='submit']");
checkboxes.click(function() {
submitButt.attr("disabled", !checkboxes.is(":checked"));
});
});
</script>
These are my tries failed attempts.
B4X:
Private joWV As JavaObject = wv
' joWV.RunMethodJO("getEngine", Null).RunMethod("executeScript", Array As String("document.getElementsByName('nominee')[3].value = 'true'"))
'joWV.RunMethodJO("getEngine", Null).RunMethod("executeScript", Array As String("document.getElementsByClassName('check')[0].disabled = false"))
' joWV.RunMethodJO("getEngine", Null).RunMethod("executeScript", Array As String("document.getElementsByClassName('check')[0].checked = true"))
'joWV.RunMethodJO("getEngine", Null).RunMethod("executeScript", Array As String("document.getElementsByClassName('check')[0].click();"))
joWV.RunMethodJO("getEngine", Null).RunMethod("executeScript", Array ("document.forms[0].check[0].checked=true;"))