Hi,
I need help for my program. Basically what I am trying to do is simple.
I called out the website in webBrowser, the website contain some fields like firstname and lastname.
When I pressed the button, the field will reflect the value that I want to post and when I pressed submit button it will reflect the change. But unfortunately it won't, the values are there in the website but when i pressed the submit button, the website still show no values were posted. I need to move my mouse and pointed to that field and pressed enter key the the value will reflected. My question : is there any way I can have the value auto reflected on the field (textbox).
private void button1_Click(object sender, EventArgs e)
{
webBrowser1.document.GetElementById("mx359").Focus();
webBrowser1.document.GetElementById("mx359").InnerText = "Mary";
webBrowser1.document.GetElementById("mx479").Focus();
webBrowser1.document.GetElementById("mx479").InnerText = "Simpson";
}
4 Replies - 158 Views - Last Post: 06 January 2013 - 01:13 PM
#1
Fields in webbrowser not auto updated. After setting the value.
Posted 05 January 2013 - 03:39 AM
Replies To: Fields in webbrowser not auto updated. After setting the value.
#2
Re: Fields in webbrowser not auto updated. After setting the value.
Posted 05 January 2013 - 04:04 PM
you try calling Refresh() on the Webbrowser object?
#3
Re: Fields in webbrowser not auto updated. After setting the value.
Posted 05 January 2013 - 06:28 PM
It also depends on the webpage. Some webpages depend on Javascript to store of its values. So simply modifying the HTML DOM isn't going to invoke any of the Javascript.
#4
Re: Fields in webbrowser not auto updated. After setting the value.
Posted 06 January 2013 - 02:09 AM
Hi , Thank you for your reply.
@Momerath , I am not trying to call Refresh() on my web.
@Skydiver , yes it's Javascript website. Seems like the value I set on those fields are not taking any changes, till I have to move my mouse to that field and press enter key. What I am trying to do is, auto fill in all information on that website without any user intervention. So is there any other way to do this?
@Momerath , I am not trying to call Refresh() on my web.
@Skydiver , yes it's Javascript website. Seems like the value I set on those fields are not taking any changes, till I have to move my mouse to that field and press enter key. What I am trying to do is, auto fill in all information on that website without any user intervention. So is there any other way to do this?
#5
Re: Fields in webbrowser not auto updated. After setting the value.
Posted 06 January 2013 - 01:13 PM
Does the webpage work without Javascript? If so, you could potentially do a HTTP POST or GET and pass in some variable values as form parameters.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|