Solved

Checkbox on webbrowser control

Posted on 2014-01-21
2
334 Views
Last Modified: 2014-02-05
When I need to check a checkbox in a webbrowser control I usually:

WebBrowser2.Document.All.Item("the_value").Checked = True

But in this case, the name is strange:

        <input value="8041787595" type="checkbox" name="photos[group1.photo_ids]" />

Any Ideas?
0
Comment
Question by:hrolsons
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
Ark earned 500 total points
ID: 39799181
Looks like server-side (asp/php) error - seems developer expected set the name from an array 'photos' by 'group1.photo_ids' index but by mistake use string variable "photos[group1.photo_ids]" in quotes instead of photos[group1.photo_ids] value.
To get the DOM element you can use it as a string
WebBrowser2.Document.All.Item("photos[group1.photo_ids]").Checked = True
but when developer correct his mistake you'll need change it to real name which stored on server in photos[] array
0
 

Expert Comment

by:anwarul
ID: 39802280
function selectAll(invoker) {

            var IsChecked = invoker.checked;
            var inputElements = document.getElementsByTagName('input');

            if (invoker)
                for (var i = 0; i < inputElements.length; i++) {
                    var myElement = inputElements[i];

                    if (myElement.type === "checkbox") {

                        if (IsChecked) {
                            if (!myElement.checked) {
                               //do waht you want
                            }

                        }
                        else {
                            if (myElement.checked) {
                               //do waht you want
                            }

                        }

                    }
                }
        }

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question