4 Replies - 460 Views - Last Post: 06 January 2013 - 01:13 PM Rate Topic: -----

#1 lambert27  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-January 13

Fields in webbrowser not auto updated. After setting the value.

Posted 05 January 2013 - 03:39 AM

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";
}

Is This A Good Question/Topic? 0
  • +

Replies To: Fields in webbrowser not auto updated. After setting the value.

#2 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1012
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

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?
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3662
  • View blog
  • Posts: 11,472
  • Joined: 05-May 12

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.
Was This Post Helpful? 0
  • +
  • -

#4 lambert27  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-January 13

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?
Was This Post Helpful? 0
  • +
  • -

#5 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3662
  • View blog
  • Posts: 11,472
  • Joined: 05-May 12

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1