Link to home
Start Free TrialLog in
Avatar of praneetha
praneetha

asked on

print Selected value from Select in HTML

if i have this in my ascx

   <select id="testList" name="testList" >
                          <options>
;;
;;;

                        </select>

and in same ascx i would like to print the selected value how do i do it.

 <td  colspan="1">
                   <%  print the select value here? %>
                    </td>

Avatar of Smart_Man
Smart_Man
Flag of Egypt image

print it like on a printer or a form ?

please more details

waiting for your reply
Avatar of Michel Plungjan
Like this:
<select id="testList" name="testList"
onChange="document.getElementById('cellID').innerHTML=this.options[this.selectedIndex].value">
<options>
.
.
.
</select>
<td  colspan="1" id="cellID"></td>

Open in new window

can you specify more details. is my help welcomed ?
I guessed Print as in show... Not as in print on printer
Avatar of praneetha
praneetha

ASKER

 CountryName = formObj.CountryList.options[document.forms['frm'].CountryList.selectedIndex].text;
              document.getElementById("countryName").innerHTML=htmlEncode(CountryName);
                
no objection
So the code I suggested was correct.
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
waiting for reply from the author
We got the reply: delete question
Yes objections.

My code answered the question and the last comment showed how to use the code in the actual setting.
after reviewing ... mplungjan .. deserves points...

i agree on that