0

I have modal dialog opening by click

Modal body is Partial View

Here is code of partial view

<div style="height: 400px;overflow-y: scroll">
    <div class="form-group" style="text-align:center;padding-bottom: 20px; padding-top: 10px;">
    <input type="text" class="form-control" id="Name" , placeholder="Enter First and Last Name " />
    </div>
    <div class="form-group" style="text-align:center;padding-bottom: 20px; padding-top: 10px;">
   <input type="text" class="form-control" id="sex" , placeholder="Sex" />
</div>

I call modal in main View like this

<div class="modal fade" id="addPatient" style="z-index: 5" role="dialog" data-backdrop="false">
<div class="modal-dialog">
    <!-- Modal content-->
    <div class="modal-content">
        <div class="modal-body">
            <p style="font-size: 20px;">Appointment successfully created </p>
        </div>
        <div class="modal-footer">
            @Html.Partial("~/Views/PatientDatabase/AddingPatient.cshtml")
        </div>
    </div>

</div>

But my inputs displaying in one row.

Like this

Screen

Where problem can be?

As I understood it must display not in one row.

11
  • 1
    That depends entirely on the CSS you use to style the inputs, specifically these classes : .form-group, and / or .form-group input Commented Aug 10, 2017 at 7:37
  • Create fiddle for us Commented Aug 10, 2017 at 7:38
  • 1
    also, the HTML you posted is incomplete, in your partial i am missing a </div> closing tag Commented Aug 10, 2017 at 7:39
  • 1
    @mmushtaq where does that modal-title come from? i don't see it anywhere in OP's code, and making blind assumptions like that is dangerous. Commented Aug 10, 2017 at 7:43
  • 1
    @mmushtaq you can only make assumptions on the part of OP's code you are not seeing. my advise is ; try not to do that, or try to do it as little as possible ; you might be giving out bad advise without knowing it. Commented Aug 10, 2017 at 7:46

1 Answer 1

1

Hope there is float : left in form-group class. So add clear:both in those div's style attribute.

<div style="height: 400px;overflow-y: scroll">
    <div class="form-group" style="clear:both;text-align:center;padding-bottom: 20px; padding-top: 10px;">
    <input type="text" class="form-control" id="Name" , placeholder="Enter First and Last Name " />
    </div>
    <div class="form-group" style="clear:both;text-align:center;padding-bottom: 20px; padding-top: 10px;">
   <input type="text" class="form-control" id="sex" , placeholder="Sex" />
   </div>
</div>
Sign up to request clarification or add additional context in comments.

2 Comments

don't hope anything. you're a developer, you can make sure you know it.
I don't hope anything in mycode boss. If somebody did't give me full code then, I can only hope. :( @TimothyGroote

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.