Question how to fill web forms and post through web browser?


Active member
Jul 19, 2010
Programming Experience
i have a form on one of my pages. How do i post the form after filling the data ? :

<form action='' method='post' class='lj_login_form pkg'>
<input type='hidden' name="lj_form_auth" value="c0:1279620000:865:86400:D8a3Ppn6DR-0-m5d4E2aEUQJXIvB:d696e52500ec16761d03da8e55d6a1c4" /><input type='hidden' name='chal' class='lj_login_chal' value='c0:1279620000:865:300:fh20VHeagtfjQ83RJlaM:0ddf0f828e8140c66e648307b44eaa7c' />
<input type='hidden' name='response' class='lj_login_response' value='' />
<h2>Log in to mysite</h2>

<fieldset class='pkg nostyle'>
<label for='user' class='left'>Username:</label>
<input type='text' value='' name='user' id='user' class='text' size='18' maxlength='17' style='' />
<fieldset class='pkg nostyle'>
<label for='lj_loginwidget_password' class='left'>Password:</label>
<input type='password' id='lj_loginwidget_password' name='password' class='lj_login_password text' size='20' maxlength='30' /><a href='' class='small-link'>Forgot password?</a>
<p><input type='checkbox' name='remember_me' id='remember_me' value='1' tabindex='4' /> <label for='remember_me'>Remember me</label></p><p><input name='action:login' type='submit' value='Log in...' /> <a href='' class='small-link'>Login with Open ID</a></p><p><img src='' width='20' height='16' class='secure-image' alt='secure login' /> <a href=''>Secure</a> | Standard</p>


i fill form through web browser control in the following way :

WebBrowser1.Document.GetElementById("user").SetAttribute("value", "123")
WebBrowser1.Document.GetElementById("lj_loginwidget_password").SetAttribute("value", "xyz")


this method does fill the form but does not post it. Any ideas on this?
Top Bottom