?
Solved

Checkbox on webbrowser control

Posted on 2014-01-21
2
Medium Priority
?
363 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 2000 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

Technology Partners: 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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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.
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…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

801 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