function getPay() {
var ustr = $("[id*=labUserName]").text();
var uselp=$("#selpay").val();
var str = UsersAjax.changetype(ustr, uselp);
var count = str.split("^");
if (count.length > 1) {
if (count[0] != "") {
document.getElementById("alipay").value = count[0];
document.getElementById("alipay").readOnly = true;
}
if (count[1] != "") {
document.getElementById("relname").value = count[1];
document.getElementById("relname").readOnly = true;
}
if (count[2] == "True") {
$("#isdefault").attr("checked", "checked");
}
else
{ $("#isdefault").removeAttr("checked"); }
$("#chpay").show();
}
else {
document.getElementById("alipay").value = "";
$("#alipay").removeAttr("readOnly");
document.getElementById("relname").value = "";
$("#relname").removeAttr("readOnly");
$("#isdefault").removeAttr("checked");
$("#chpay").hide();
}
<td>
<select id="selpay" onchange="getPay();">
<option value="1">支付宝</option>
<option value="2">农业银行</option>
<option value="3">工商银行</option>
<option value="4">中国银行</option>
<option value="5">建设银行</option>
<option value="6">招商银行</option>
<option value="7">财付通</option>
<option value="8">快钱</option>
</select>
</td>
<td>
<input type="checkbox" id="isdefault" />默认支付方式</td>
</td>
</tr>
<tr>
<td colspan="2">
<input type="text" size="25" style="height:25px;" name="alipay" id="alipay" runat="server" />
</td>
</tr>
</table>
</td>
<td height="20" bgcolor="#ffffff" class="style6">
支付姓名:</td>
<td height="20" bgcolor="#ffffff" class="style7">
<input id="relname" maxlength="12" name="relname" size="12" style="height:25px;" type="text" runat="server"/>
</td>
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.Read)]
public string changetype(string email, string PayType)
{
string str = "";
Alivv.BLL.Users u = new Alivv.BLL.Users();
DataTable dt = u.iUsers.Sel_UserInBas_ByType(email, PayType);
if (dt != null && dt.Rows.Count > 0)
{
str += dt.Rows[0]["PayAccount"].ToString();
str += "^" + dt.Rows[0]["PayName"].ToString();
str += "^" + dt.Rows[0]["IsDefault"].ToString();
}
return str;
}当select控件的值变化时input的值跟着变化,现在调用changetype方法都调用不了 为什么?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货