Get Combo Label using javascript

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <script type="text/javascript">
        function dispComboText(cmb){
            document.getElementById('valValue').value = cmb.value;
            document.getElementById('valText').value = cmb.options[cmb.selectedIndex].text;
      <select id="test" onchange="dispComboText(this)">
          <option value="1">A</option>
          <option value="2">B</option>
          <option value="3">C</option>
      Value : <input type="text" id="valValue"/>
      Text : <input type="text" id="valText"/>
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s