how to place check boxes

Posted on 2011-10-02
Last Modified: 2012-05-12
on the form

we have two check boxes that should align left in the right hand column.  I can get one to align but not both.  How can I do this?  Note that this is a page, so the checkbox code is generated by .net

Preferred Email Address *
(Please indicate which email address you'd         __  Participant Email Address
prefer us to use for contacting your office.)        __Administrator Email Address
Question by:d2fox
    LVL 16

    Accepted Solution

    The first solution which comes on the mind is to apply clear:left; to element, but unfortunately there is no border where it should stop. I modified html and added some style to it which can be replaced to style-sheet later if needed, so instead of <span> you need to have <div> like this one:
    <div style="position: relative;width:500px;float:right;">
    <input type="checkbox" id="ctl00_ContentPlaceHolder1_ContactParticipantByEmail" name="ctl00$ContentPlaceHolder1$ContactParticipantByEmail">
    <label for="ctl00_ContentPlaceHolder1_ContactParticipantByEmail">Participant Email Address</label>
    <input type="checkbox" id="ctl00_ContentPlaceHolder1_ContactAdministrationByEmail" name="ctl00$ContentPlaceHolder1$ContactAdministrationByEmail" style="clear:left;">
    <label for="ctl00_ContentPlaceHolder1_ContactAdministrationByEmail">Administrator Email Address</label>

    Open in new window

    replace it and have a look at it.
    LVL 15

    Expert Comment

    in Firefox it's looks good

    not relevant to the answer but when I go directly to the page I get error:

    Server Error in '/pqrs' Application.
    Object reference not set to an instance of an object. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
    Source Error: 
    Line 18:         if (!IsPostBack)
    Line 19:         {
    Line 20:             HFURL.Value = Request.UrlReferrer.ToString();
    Line 21: 
    Line 22:             if (
    Source File: c:\inetpub\nethealth\PQRS\ParticipantDetails.aspx.cs    Line: 20 
    Stack Trace: 
    [NullReferenceException: Object reference not set to an instance of an object.]
       ParticipantDetails.Page_Load(Object sender, EventArgs e) in c:\inetpub\nethealth\PQRS\ParticipantDetails.aspx.cs:20
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
    Version Information: Microsoft .NET Framework Version:2.0.50727.4211; ASP.NET Version:2.0.50727.4209 

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
    In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now