Solved

Checkbox on webbrowser control

Posted on 2014-01-21
2
320 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
2 Comments
 
LVL 27

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

757 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now