Click here to Skip to main content
15,917,968 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

The below html code which i need to select dropdown once done the next dropdown which get name list from web.

<td class="required" colspan="2" width="32%">*ID:</td>
     <td colspan="4">
       <select name="TID" class="pulldown" style="width:120px;" tabIndex="1" onKeyPress="submitEnter(window.event.keyCode,'Val','Status')" onChange="JavaScript:submitData('tid', 'Status')">
         <option value="" > Select a ID </option>

                <option value=""  selected ="selected"  >

                <option value=""  >



     <td class="required" colspan="2" width="32%">Name:</td>
     <td colspan="4">
       <select name="NameList"  class="pulldown" style="width:300px;" tabIndex="2" onKeyPress="submitEnter(window.event.keyCode,'Val','Status')" onChange="JavaScript:submitData('pr', 'Status')">
         <option value="">Select a Pr </option>

          <option value="205"  >ID only</option>

For this i written code like below

<pre lang="text"> HTMLSelectElementClass iElement = (HTMLSelectElementClass) dropdown.DomElement;
                iElement.value = value;
                //iElement.options[index].selected = true;

                object tmp = new object();
                iElement.FireEvent("onchange", ref tmp);
                //iElement.FireEvent("onkeypress", ref tmp);

Select event is not working.. The TID Dropdown is not selecting... Please let me know what issue here?
Updated 12-Sep-13 22:38pm
Prasad Khandekar 13-Sep-13 4:05am    

Do you mean to say that when a value is selected from first dropdown the next dropdown should get populated automatically with the values obtained by calling the url pointed by selected option in the first dropdown?
visnumca123 13-Sep-13 4:08am    
Prasad Khandekar 13-Sep-13 4:17am    
I have corrected my question please let me know if that's what you want to achieve.
visnumca123 13-Sep-13 4:35am    
Hi Prasad,
Once i selected the first dropdown only all the other things will work. I need to select any id first next follows different step, but here first dropdown itself not selecting. Empty value is selecting.
Please take a look at the FireBug console window in FireFox. YOu can see all the client-side errors.

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900