2013年9月13日星期五

label , I want to get listKey value through js how to get ?

RT, Baidu Google for a long time did not solve the

				<s:select list="address" headerKey="" headerValue="填写新地址" 
theme="simple" listKey="id" listValue="receiveAddress" id="addr" onchange="findAddress();">
</s:select>

is click listKey onchange event to obtain the corresponding values ​​
------ Solution -------------------------- ------------------
LZ Get options in value the value of it .
var obj = document.getElementById ('mySelect');

var index = obj.selectedIndex; / / serial number, the serial number of options to take the currently selected

var val = obj.options [index]. value;
------ For reference only -------- -------------------------------
No, that listKey value in the address table is the primary key , I think onchange event get through this id, then find the corresponding data via ajax displayed on the page
------ For reference only ------------------- --------------------
good methods available, thank you ~
------ For reference only -------- -------------------------------
top one, tangled for a long time to solve the problem ! ! ! Thank you ! !

没有评论:

发表评论