Safari & Chrome Problem - Please Help! New to Java
Hi All
Im creating a web form and have a bit of an issue with some Java that I have placed in the aspx page. It works perfectly in both Internet explorer, Firefox and Opera but not in Chrome or Safari.
Basically I have a checkbox, that upon ticking, makes a fieldset containing a drop down box and a mutli line text box appear.
I have 3 funtions, 1 for the show/hide of the field set and then one for each of the form elements. Im new to Java so there may be a better way to do this...? Anyway, the show/hide works perfectly but the enabling of the 2 new form elements just don't work in chrome or safari, theres no errors, it just seems to get ignored.
Code below:
Code:
<script language="javascript" type="text/javascript">
function nowillClicked(sender) {
document.getElementById('adminset').style.display = sender.checked ? 'block' : 'none';
}
function enableTextBox() {
var textBoxID = "<%= Administrators_Explanation.ClientID %>";
if (document.getElementById("<%= Administrators_TheEstateHasNoWill.ClientID %>").checked == true)
document.getElementById(textBoxID).disabled = false;
else
document.getElementById(textBoxID).disabled = true;
}
function enableDropBox() {
var dropBoxID = "<%= Administrators_Priority.ClientID %>";
if (document.getElementById("<%= Administrators_TheEstateHasNoWill.ClientID %>").checked == true)
document.getElementById(dropBoxID).disabled = false;
else
document.getElementById(dropBoxID).disabled = true;
}
</script>
ASP.Net Code:
Code:
<asp:CheckBox id="Administrators_TheEstateHasNoWill"
name="Administrators_TheEstateHasNoWill" Text=" The Estate Has No Will" TabIndex="23"
Checked="false" OnChange="javascript:enableTextBox();enableDropBox();" onClick="nowillClicked(this)"
CausesValidation =false runat="server" />
<div id="adminset" style="display: none;" >
<fieldset>
<legend>Administrators</legend>
<asp:DropDownList id="Administrators_Priority" name="Administrators_Priority" Enabled="false"
TabIndex="24" AutoPostBack="False" runat="server">
<asp:ListItem Value="Brother/Sister"> Brother/Sister </asp:ListItem>
<asp:ListItem Value="Children"> Children </asp:ListItem>
<asp:ListItem Value="Parents"> Parents </asp:ListItem>
<asp:ListItem Selected="True" Value="Spouse"> Spouse </asp:ListItem>
</asp:DropDownList>
<asp:Label ID="Label78" runat="server" CssClass="FormHeader" AssociatedControlID="Administrators_Explanation" >
Explain why the people in the categories above are not applying (Unless Spouse is selected above):
</asp:Label>
<asp:TextBox ID="Administrators_Explanation" name="Administrators_Explanation"
Enabled="false" runat="server" Width="100%" Rows=5 TabIndex="25"
TextMode=MultiLine></asp:TextBox>
</fieldset>
</div>
Tried to trim as much of the none relevant parts of that code out.
But this has been driving me mad, I cannot get the Re-Enabling two functions to work in Chrome or Safari.
Thanks very much in advance for any help anyone can offer.
Regards
Danny
Re: Safari & Chrome Problem - Please Help! New to Java
Java is not JavaScript. I suggest you find a JavaScript forum.
Re: Safari & Chrome Problem - Please Help! New to Java
oh right sorry. my bad, ill be on my way.