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.
23 Replies - 7099 Views - Last Post: 20 November 2012 - 07:48 AM
Replies To: How to uncheck a checkbox in vb.net webbrowser?
#2
Re: How to uncheck a checkbox in vb.net webbrowser?
Posted 12 April 2011 - 12:10 PM
try
el.removeAttribute("checked");
#3
Re: How to uncheck a checkbox in vb.net webbrowser?
Posted 13 April 2011 - 04:36 AM
no that is not a function.
#4
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
hope that helps
checkbox.checked = true 'to uncheck checkbox.checked = false
hope that helps
#5
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
#6
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?
#7
Re: How to uncheck a checkbox in vb.net webbrowser?
Posted 13 April 2011 - 05:12 PM
#8
#9
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.
#10
Re: How to uncheck a checkbox in vb.net webbrowser?
Posted 14 April 2011 - 05:08 AM
Oh okay, sorry.
#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?
#12
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.
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
#13
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")
#14
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.
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.
#15
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.
|
|

New Topic/Question
Reply



MultiQuote






|