我有一個form
標籤內的簡單asp:RadioButtonList
但由於某種原因它不保持它在回傳值ASP.NET複選框由於JavaScript/jQuery數組而在回發中丟失值?
這裏就是我有
<form runat="server">
<div class="Form">
<span class="FirstField">
<asp:RadioButtonList runat="server" ID="radiolist1" AutoPostBack="true" RepeatDirection="Horizontal">
<asp:ListItem Text="Yes" />
<asp:ListItem Text="No" />
</asp:RadioButtonList>
</span>
</div>
</form>
此刻所有我想要做是讓它在回發時保持它的價值 - 它在Safari中工作,但不在Firefox或Internet Explorer中。
任何想法?
編輯:
我剛剛發現它是事做我的javascript在我的網頁
$(document).ready(function() {
var originalValues = new Array();
$("input").focus(function() {
if (!originalValues[this.id]) {
originalValues[this.id] = $(this).val()
}
if ($(this).val()==originalValues[this.id]) {
$(this).val('').css({'color': "#000", 'font-style': 'normal'});
}
$(this).css({'background-color':'#E8E8E8' });
});
$("input").blur(function() {
if ($(this).attr("value")=="") {
$(this).val(originalValues[this.id]).css({'color': "#666", 'font-style': 'normal', 'font-weight': 'normal'});
}
$(this).css({'background-color':'#fff' });
});
});
看看我的答案的更新。你應該從這個jQuery函數中排除`input type = radio`。 – 2011-02-01 11:03:45