Solved

Checkbox on webbrowser control

Posted on 2014-01-21
2
331 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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

860 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