BeniBela,
I have checked the docs you had suggested, but it is not clear yet.
This is my first attempt to use internet-tools with a login form, probably best to paste the relevant html elements here:
Form:
<form id="loginForm" name="tform" action="/login/UI/Login" method="post"><div style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;overflow:hidden"><input type="hidden" name="loginForm_hf_0" id="loginForm_hf_0"></div>
User:
<div class="fInput">
<input name="logonIdX" id="tf-logonIdX" type="text" class="textInp loginid error" min="0" step="any" autocomplete="off" tabindex="1" value="">
Password:
<div class="fInput">
<input name="logonId" id="tf-logonId" type="hidden" value=""> [[One could think that this should be the input for the user, but the browser debugger shows the previous one ]]
<input name="password" id="tf-password1" type="password" class="textInp password error" autocomplete="off" tabindex="2" value="">
These are other ways I have tried but the login is still unsuccessful:
Page2:= Page.map('form(id("loginForm"), {id("tf-logonId"): $_1, id("tf-password1"): $_2})', ...
Page2:= Page.map('form(id("loginForm"), {id("tf-logonIdX"): $_1, id("tf-password1"): $_2})', ...
About error handling:
I need to make sure that mapping founds all elements and is able to assign a value to them before posting the form.
There are 2 ways it could work:
1. validate all the element references before mapping
2. handling the errors returned by mapping (Tried with deliberately wrong form id, but there was no signal of error.)
A skeleton error handling code would be nice to see how to write solid code with internet-tools.