Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
<td>
<span>Passport Type </span>
 </td>
<td colspan="3">
<div class="t-widget t-dropdown t-header" tabindex="10" title="Type of passport carried by the visa applicant"><div class="t-dropdown-wrap t-state-default"><span class="t-input">&nbsp;</span><span class="t-select"><span class="t-icon t-arrow-down">select</span></span></div>&lt;input id="PASSPORType" name="PASSPORType" style="display:none" type="text" value="" /&gt;</div>
<span class="field-validation-valid" data-valmsg-for="PASSPORType" data-valmsg-replace="true"></span>
</td>
 
//<![CDATA[
jQuery(document).ready(function(){
jQuery('#PASSPORType').tDropDownList({data:[{"Text":"","Value":""},{"Text":"Normal","Value":"1"},{"Text":"Diplomatic","Value":"2"},{"Text":"Special","Value":"3"},{"Text":"Hajj Cert","Value":"4"},{"Text":"Travel Cert","Value":"5"}]});
//
</script>
    <script src="/Scripts/jquery-ui-1.8.23/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script>
</body>
</html>
I want to send values to dropdown list on website which is open in webbrowser control but it can not done by
webBrowser1.Document.GetElementById("VisaKind").InnerText = "Special"
so what will i do ...kindly help me thanks in advance
Posted 18-Feb-13 2:41am
Edited 18-Feb-13 2:43am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
I have a suggestion. But i don't know that it solve your problem. You should try and see.
 
I think you may send dropdownlist data as xml with http post. And you shold get this data than set your dropdown list.
 
look at google for more info like this: sending xml data over http.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

this code
webBrowser1.Document.GetElementById("DateTimePicker").InnerText = "1/1/2013"
is also working for date although it contain same script and jequery but it is not working for dropdownlist.....
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi,
 
here the solution to our problem (I'm working on the same project - Saudi Arabia Visas. My Software was working with old site and now I'm updating. It's really cool.)
 
Here's some functions
 
- Import directly the picture from the scanner with the correct size.
- Import data from invitation letter (Name,Nationality, SponsorName, SponsorAddress, SponsorId etc etc) and fill the form automatically.
- Print Visa Form
- Back up in a db all the passport data, so the next visa you don't have to write again (Passport Number, expire, residence, and so on)
- It translates the invitation letter from arabic.
 
That's just a look, but it does a lot more. Smile | :)
 
But... let's come back to our problem....I've spent all night long to solve it but in the end it's done Smile | :)
 
I've decided to inject a function to change all the DropDownList value.
 
webBrowser1.Document.InvokeScript("eval", New String() {"function ImpostaDrop(Lista,Valore) { var dropDownList = $(Lista).data('tDropDownList'); dropDownList.select(Valore);  }"})
 
And when I need to change a value here's the VB Code.
 
WebDocument1.Document.InvokeScript("eval", New String() {"ImpostaDrop('#VisaKind',2)"})
 
It works great !!! Big Grin | :-D
 
I'd like to see your software running. Let's keep in touch !!
 
Alex from Italy
  Permalink  
v2
Comments
shekomero at 26-Mar-14 11:49am
   
i am interesting in above code, i have troubles converting this to Vb.net .. any help?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.141022.2 | Last Updated 8 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100