SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Dec 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Formatting my form POSTBACK in html containing a Checkbox

    Dear Forum,

    I'm very new to ASP.NET. I'm trying to set my form to postback in html but with a Checkbox

    The form I have works fine and postback to email is ok. After changing it to use html this also works fine, but after adding a Checkbox to the form, this does not postback either true or false depending how it is set in the form. I assume I'm just not coding this correct in either the runat server and or in the myMessage.Body

    Here is a small part of how I have set the form for postback in html. The part in orange is the part I assume is incorrect and where I'm trying to read and postback in email when the checkbox is ticked.

    myMessage.Body = "<p><b>First Name</b>&nbsp " & _
    HttpUtility.HtmlEncode(First_Name.Text) & "</p>" & _
    "<p><b>Surname</b>&nbsp " & _
    HttpUtility.HtmlEncode(Surname.Text) & "</p>" & "<hr />" & _
    "<p><b>Please tick box to confirm you are a fully paid up BISC member</b>&nbsp " & _
    "<input id='Checkbox1 type='checkbox' checked ='True'/>" & _
    HttpUtility.HtmlEncode(Checkbox1.Text) & "</p>"



    For the The Runat server part code all I have is the following:

    Please tick box to confirm you are a fully paid up BISC member:
    &nbsp;<asp:CheckBox id="Checkbox1" runat="server" /><br /><br />

    Any help or ideas how to code this would be appreciated.

    Regards
    Kevin

  2. #2
    SitePoint Member
    Join Date
    Dec 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi It seems like we both have similar problems but not quite the same. Are you using AutoPostBack="True" as I thought that captures the selection as it is made?

    Regards
    Kevin


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •