---
title: "select 同时传送两个值"
author: "renky"
date: "2010-05-19T18:43:50Z"
tags: []
categories: ["Web前端"]
slug: "select"
draft: false
lastmod: "2010-05-19T18:43:50Z"
id: 670117
url: "https://renky.iteye.com/blog/670117"
---

&lt;form action="" method="get"&gt;  
    
     &lt;input type=text name=id value=""&gt;  
     &lt;input type=text name=code value=""&gt;

       

      &lt;select onchange="this.form.id.value=this.value;  
          this.form.code.value=this.options\[this.selectedIndex].text;"&gt;  
          

         &lt;option value="123"&gt;aaa&lt;/option&gt;  
          &lt;option value="456"&gt;bbb&lt;/option&gt;  
          &lt;option value="789"&gt;ccc&lt;/option&gt;

      &lt;/select&gt;  
   
&lt;/form&gt;