Click here to Skip to main content
15,888,351 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.

HTML
<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="ListAction.do?TID=205&FUNCTION=Status&txn=Status"  selected ="selected"  >
                    205
                </option>



                <option value="ListAction.do?TID=331&FUNCTION=Status&txn=Status"  >
                    331
                </option>


     </select>
     </td>


 <tr>



     <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

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

                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?
Posted
Updated 12-Sep-13 22:38pm
v3
Comments
Prasad Khandekar 13-Sep-13 4:05am    
Hello,

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    
yes
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