如果涉及到数据库,在下拉选单选中不同值时,文本框的值对应到其他字段值??

如果有一个数据库含有名称、单价、数量字段,当Select选择名称时,一个文本框显示单价、一个显示数量,怎么写??

---------------------------------------------------------------

1<form>
2<select onchange="this.form.quantity=this.options[this.selectedIndex].getAttribute('quantity');this.form.price=this.options[this.selectedIndex].getAttribute('price'); ">
3<option price="单价" quantity="数量">名称</option>
4</select>
5<input name="quantity"/>
6<input name="price"/>
7</form>
Published At
Categories with Web编程
comments powered by Disqus