2009-08-21 3 views
0

Ich denke, es die Platzierung des C# -Code ist, dass meine Radio-Buttons machen nicht richtig funktionieren - dieser Fehler bisher nur im IE bis angezeigt wird. Hoffe, das ist genug Info, um ein Feedback zu bekommen, ich bin nur ein HTML/CSS/JS-Entwickler, danke!kann beiden Optionsfelder in IE wählen - C#

<% using(Html.BeginForm("CreateCustomerAccountLogin","BookingLogin")) {%> 
    <%=this.Hidden(x=>x.SID) %> 
     <div><input class="radio" type="radio" name="NewAccount" checked="checked" value="true" /> 
     <label> 
      I want to create a new account 
     </label></div> 
     <div id="new-account"> 
     <%=this.TextBox(x => x.LoginName).Label("Email Address:")%> 
     <br /> 
     <%=this.TextBox(x => x.ConfirmLoginName).Label("Confirm Email Address:")%><%= this.ValidationMessage(x=>x.ConfirmLoginName) %> 
     <br /> 
     <%=this.Password(x => x.Password).Label("Password:")%><%= this.ValidationMessage(x=>x.Password) %> 
     <br /> 
     <%=this.Password(x => x.Password).Label("Confirm Password:")%> 
     <br /> 
     <%=this.TextBox(x => x.ZipCode).Label("ZipCode:")%><%= this.ValidationMessage(x=>x.ZipCode) %> 
     <br /> 
     <% } %> 
     </div> 
    <div><input class="radio" type="radio" name="NewAccount" value="false" /> 
     <label class="wide"> 
      I want to continue without logging in 
     </label> 
    <div> 
      <div class="button-container-right"> 
       <input class="button-primary" type="image" src="../Content/images/button-primary.jpg" border="0" id="btnSubmit" /></div></div></div> 
+0

, wenn Sie das neue Konto div entfernen und der Inhalt tritt das Problem noch zeigen, in IE up? – jim

+0

und es sieht aus wie checked = "checked" sollte nur überprüft werden. – jim

+0

checked = "checked" ist in Ordnung, und richtig für XHTML. – bobince

Antwort

3

Gibt es in gerenderten HTML-Code Teil derselben Radiobutton Formular-Tag? Wenn nicht versuchen, sie zu einem Teil desselben Form Tag zu machen, die Ihr Problem lösen sollen.

+0

Ich glaube ARS hat Recht. Verschieben Sie die endliche geschweifte Klammer irgendwo unter dem zweiten Optionsfeld ... – Daniel

3

Der zweite Knopf außerhalb der gerenderten Form. Wenn Sie möchten, dass die Optionsfelder als eine Gruppe behandelt werden, müssen Sie die zweite Schaltfläche in das Formular verschieben.

Hier, wo die Form beginnt:

<% using(Html.BeginForm("CreateCustomerAccountLogin","BookingLogin")) {%> 

Hier ist alles, was in der Form ist:

<%=this.Hidden(x=>x.SID) %> 
    <div><input class="radio" type="radio" name="NewAccount" checked="checked" value="true" /> 
    <label> 
     I want to create a new account 
    </label></div> 
    <div id="new-account"> 
    <%=this.TextBox(x => x.LoginName).Label("Email Address:")%> 
    <br /> 
    <%=this.TextBox(x => x.ConfirmLoginName).Label("Confirm Email Address:")%><%= this.ValidationMessage(x=>x.ConfirmLoginName) %> 
    <br /> 
    <%=this.Password(x => x.Password).Label("Password:")%><%= this.ValidationMessage(x=>x.Password) %> 
    <br /> 
    <%=this.Password(x => x.Password).Label("Confirm Password:")%> 
    <br /> 
    <%=this.TextBox(x => x.ZipCode).Label("ZipCode:")%><%= this.ValidationMessage(x=>x.ZipCode) %> 
    <br /> 

Hier, wo die Form endet:

<% } %> 

Und hier ist alles andere, außerhalb die Form:

</div> 
<div><input class="radio" type="radio" name="NewAccount" value="false" /> 
    <label class="wide"> 
     I want to continue without logging in 
    </label> 
<div> 
     <div class="button-container-right"> 
      <input class="button-primary" type="image" src="../Content/images/button-primary.jpg" border="0" id="btnSubmit" /></div></div></div>