Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

webbroser control issue

$
0
0

Hi all,


I am loading a page into my webbrowser. In this page there is a form and there are some radiobuttons in this form like the following:

<form id="choose_dept" method="POST" action="/place">

One of the radio button in this form is like the following:

<input id="dept_chicken" type="radio" name="department" value="chicken"/>

When user clicks any of the radio button, there is a JQuery code in the html and it basically changes the form action target url depending on the clicked radio button:

$("#choose_dept").change(function(){$("#choose_dept").attr('action', '/place/' + $('input[name=department]:checked').val() + '/' );

  this.submit();
});

So basically, after clicking the radiobutton for chicken, the form action will be changed as "/place/chicken/"

Here is the actual question:

When I try to automated this click in my webbrowser element, I use the following code to select the chicken radio button.

webBrowser1.Document.GetElementById("dept_chicken").SetAttribute("checked", "checked");

However, this does not trigger the JQuery function. It just selects the radio button. What can I do to emulate the change event as if I clicked on the chicken radio button?

Thanks.





Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>