Are dots legal in the name property of an HTML button

Posted by justSteve on Stack Overflow See other posts from Stack Overflow or by justSteve
Published on 2010-04-15T23:07:41Z Indexed on 2010/04/15 23:13 UTC
Read the original article Hit count: 331

Filed under:
|
|

a page with a bit of MVC code:

<%=Html.SubmitButton("ChooseWebinar.Submit", "Continue to Registration Details")%><br/>

that generates an input button where the '.' is embedded in the name: [rendered html]

At page load this control (the submit button) is hidden - when one of two different dropdowns registers a value, the button is shown:

function toggleChooseWebinarSubmit() {
if ($("#ChooseWebinar_RecordedWebinarId").val() || $("#ChooseWebinar_UpcomingWebinarId").val()) {
    $("#ChooseWebinar_Submit").show();
} else {
    $("#ChooseWebinar_Submit").hide();
}

I've just received a report from an IE8 user who says that after selecting a value in a dropdown, the button is _not displaying. I can't reproduce the condition (i've tried compatibility mode too).

Obviously the show/hide is targeting the 'ID' selector but i can't help but wonder about that period in the control's name.

Any known issues? - or perhaps the .change is problematic and the toggle's never getting called:

$(window).load(function() {
    toggleChooseWebinarSubmit();
    $("#ChooseWebinar_UpcomingWebinarId").change(function() {
        if ($(this).val()) {
            $("#ChooseWebinar_RecordedWebinarId").val("");
        }
        toggleChooseWebinarSubmit();
    });
    $("#ChooseWebinar_RecordedWebinarId").change(function() {
        if ($(this).val()) {
            $("#ChooseWebinar_UpcomingWebinarId").val("");
        }
        toggleChooseWebinarSubmit();
    });
});

thx

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about jQuery