How to uncheck a checkbox in vb.net webbrowser?

  • (2 Pages)
  • +
  • 1
  • 2

23 Replies - 12136 Views - Last Post: 20 November 2012 - 07:48 AM Rate Topic: -----

#1 tyscof  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 28-March 11

How to uncheck a checkbox in vb.net webbrowser?

Posted 12 April 2011 - 11:39 AM

Ok so I am making a webbrowser that will automatically log me in as I browse. But I am having a problem. I can use: el.SetAttribute("checked", "checked")
To check a check box but I cannot use it to uncheck the check box. =[ Any one know the code to uncheck a check box on a webpage vb.net webbrowser? i have tried all sorts of stuff like:
el.SetAttribute("unchecked", "unchecked")
el.SetAttribute("0", "0")
el.SetAttribute("", "")
el.SetAttribute(0, 0)
but none of them worked.

Is This A Good Question/Topic? 0
  • +

Replies To: How to uncheck a checkbox in vb.net webbrowser?

#2 LaughingBelly  Icon User is offline

  • D.I.C Head

Reputation: 47
  • View blog
  • Posts: 103
  • Joined: 11-April 11

Re: How to uncheck a checkbox in vb.net webbrowser?

Posted 12 April 2011 - 12:10 PM

try
el.removeAttribute("checked");

Was This Post Helpful? 0
  • +
  • -

#3 tyscof  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 28-March 11

Re: How to uncheck a checkbox in vb.net webbrowser?

Posted 13 April 2011 - 04:36 AM

no that is not a function.
Was This Post Helpful? 0
  • +
  • -

#4 RedRabbit  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 71
  • Joined: 09-May 10

Re: How to uncheck a checkbox in vb.net webbrowser?

Posted 13 April 2011 - 05:25 AM

I know with vb.net you set the checkbox as

checkbox.checked = true

'to uncheck
checkbox.checked = false



hope that helps
Was This Post Helpful? 0
  • +
  • -

#5 tyscof  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 28-March 11

Re: How to uncheck a checkbox in vb.net webbrowser?

Posted 13 April 2011 - 09:37 AM

checkbox.checked = true

'to uncheck
checkbox.checked = false


thats not for an html element
Was This Post Helpful? 0
  • +
  • -

#6 LaughingBelly  Icon User is offline

  • D.I.C Head

Reputation: 47
  • View blog
  • Posts: 103
  • Joined: 11-April 11

Re: How to uncheck a checkbox in vb.net webbrowser?

Posted 13 April 2011 - 09:41 AM

If there is SetAttribute, I am surprised there is nothing to remove attribute. Have you tried RemoveAttribute?
Was This Post Helpful? 0
  • +
  • -

#7 tyscof  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 28-March 11

Re: How to uncheck a checkbox in vb.net webbrowser?

Posted 13 April 2011 - 05:12 PM

View PostLaughingBelly, on 13 April 2011 - 09:41 AM, said:

If there is SetAttribute, I am surprised there is nothing to remove attribute. Have you tried RemoveAttribute?

yes i tried it. it just pulls an error if i try it.
Was This Post Helpful? 0
  • +
  • -

#8 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,505
  • Joined: 16-March 11

Re: How to uncheck a checkbox in vb.net webbrowser?

Posted 13 April 2011 - 05:39 PM

View Posttyscof, on 13 April 2011 - 05:12 PM, said:

View PostLaughingBelly, on 13 April 2011 - 09:41 AM, said:

If there is SetAttribute, I am surprised there is nothing to remove attribute. Have you tried RemoveAttribute?

yes i tried it. it just pulls an error if i try it.


Well telling us there is an error doesn't help, describe it maybe?
Was This Post Helpful? 0
  • +
  • -

#9 tyscof  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 28-March 11

Re: How to uncheck a checkbox in vb.net webbrowser?

Posted 14 April 2011 - 04:48 AM

Quote

Well telling us there is an error doesn't help, describe it maybe?

No I mean the function doesn't exists. The error just says that its not part of telesence.
Was This Post Helpful? 0
  • +
  • -

#10 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,505
  • Joined: 16-March 11

Re: How to uncheck a checkbox in vb.net webbrowser?

Posted 14 April 2011 - 05:08 AM

Oh okay, sorry.
Was This Post Helpful? 0
  • +
  • -

#11 LaughingBelly  Icon User is offline

  • D.I.C Head

Reputation: 47
  • View blog
  • Posts: 103
  • Joined: 11-April 11

Re: How to uncheck a checkbox in vb.net webbrowser?

Posted 14 April 2011 - 08:05 AM

I think you will get a better response if you post some of the code around it. It will give context on what el is as well. Is SetAttribute something you wrote? what is el?
Was This Post Helpful? 0
  • +
  • -

#12 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: How to uncheck a checkbox in vb.net webbrowser?

Posted 14 April 2011 - 04:13 PM

Not sure but SetAttribute's parameters are AttributeName and Value and since you used
el.SetAttribute("checked", "checked") and that worked, did you try
el.SetAttribute("checked", "unchecked")

Since you're talking about the same attributename.

Of course, I have no idea if unchecked is a valid value it's just a guess.

Maybe some code that sets up your document for the browser would help.

This post has been edited by CharlieMay: 14 April 2011 - 04:13 PM

Was This Post Helpful? 1
  • +
  • -

#13 Jack Eagles1  Icon User is offline

  • Pugnacious Penguin (inspired by no2pencil)
  • member icon

Reputation: 183
  • View blog
  • Posts: 1,152
  • Joined: 10-December 08

Re: How to uncheck a checkbox in vb.net webbrowser?

Posted 14 April 2011 - 04:59 PM

Well, assuming you know for sure that the checkbox is checked, you can use:

el.InvokeMember("click")

Was This Post Helpful? 0
  • +
  • -

#14 tyscof  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 28-March 11

Re: How to uncheck a checkbox in vb.net webbrowser?

Posted 15 April 2011 - 04:43 AM

yes i tried the checked unchecked.
No i would not know if the box is checked or not. So i need a way to uncheck it just like set attribute checked checked with check it even if it is already checked.
Was This Post Helpful? 0
  • +
  • -

#15 LaughingBelly  Icon User is offline

  • D.I.C Head

Reputation: 47
  • View blog
  • Posts: 103
  • Joined: 11-April 11

Re: How to uncheck a checkbox in vb.net webbrowser?

Posted 15 April 2011 - 08:31 AM

So go ahead and post some code around the problem area. Without it we are all assuming a lot of things.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2