mardi 31 mars 2015

How to login by filling a form in a website using Android

I'm trying to log on to a website that has a form to which you should provide user-name and password, check a box, and press a login button. I tried all kinds of httpClient POST messages, but it seems that it is not working. Can anyone assist and point to an example of skeleton of android Java way to login? Here is the form from the html page:



<form name="loginForm" method="post" action="/login.do">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10px">&nbsp;</td>
<td><label class="formLabel" for="loginID">Username</label></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="text" name="username" value="" class="formTextField"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><label class="formLabel" for="password"> Password</label></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="password" name="password" value="" class="formTextField"></td>
</tr>

<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="checkbox" name="agreement" value="on" class="formTextField">

I agree with <div>
<b><a href="javascript:openPopup('ext/ibsContent/terms.pdf')">Terms and Conditions</a></b></div>

</td>
</tr>

</table>
<p><input type="submit" value="Login" class="FPFormFieldB"></p>
<p><a href="navigate.do?anode=user_ChangePassword">Have you forgotten the password?</a></p>
<p><a href="navigate.do?anode=user_Registration">New user registration</a></p>

</form>

Aucun commentaire:

Enregistrer un commentaire