如何在打印预览模式下在MVC中的文本框内容中获取Underscore

时间:2017-04-24 13:34:59

标签: javascript jquery model-view-controller asp.net-mvc-5

我在打印预览页面上打印文本框,标签和下拉列表值。在这里,我附上了Codepen链接以及我已经完成的代码。

HTML

didFinishRecordingToOutputFileAt

和Jquery:

<form>
  <div class="container no-print">
    <div class="row" id="DivDate">
      <div class="col-lg-12">
        <div class="col-lg-12">
          <div class="pull-right">
            <input type="text" name="CreatedDate" placeholder="DD/MM/YYYY" class="form-control" />
          </div>
        </div>
      </div>
    </div>
    <div id="DivDoc">
      <div class="row">
        <div class="col-lg-12">
          <div class="form-group">
            <label class="col-md-2 col-xs-4">
                            Respected Dr.
                        </label>
            <div class="col-md-10 col-xs-8">
              <input type="text" name="txtDoctor" placeholder="Doctor Name" class="form-control" />
            </div>
          </div>
        </div>
      </div>
    </div>
    <div id="DivData">
      <div class="row">
        <div class="col-lg-12">
          <div class="form-group">
            <label class="col-xs-2">
                            Referring
                        </label>
            <div class="col-xs-4 col-md-2">
              <select name="ddlGender" class="form-control">
                                <option value="Mr.">Mr.</option>
                                <option value="Mrs.">Mrs.</option>
                                <option value="Miss">Miss</option>
                            </select>
            </div>
            <div class="col-xs-6 col-md-8">
              <input type="text" name="txtPatient" placeholder="Patient Name" class="form-control" />
            </div>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-lg-12">
          <div class="form-group">
            <label class="col-xs-9 col-sm-8 col-md-6">
                            to you for the favour of your kind consultation of
                        </label>
            <div class="col-xs-3 col-sm-4 col-md-6">
              <select name="ddlGender" class="form-control">
                                <option value="his">his</option>
                                <option value="her">her</option>
                            </select>
            </div>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-lg-12">
          <div class="form-group">
            <div class="col-xs-3">
              <select name="ddlOption" class="form-control">
                                <option value="C/O">C/O</option>
                            </select>.
            </div>
            <label class="col-xs-9">
                            <input type="text" class="form-control" />
                        </label>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-lg-12">
          <div class="form-group">
            <label class="col-xs-9 col-sm-8 col-md-6">
                            Please do the needful to evaluate the case and treat
                        </label>
            <div class="col-xs-3 col-sm-4 col-md-6">
              <select name="ddlGender" class="form-control">
                                <option value="him">him</option>
                                <option value="her">her</option>
                            </select>
            </div>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-lg-12">
          <div class="form-group">
            <label class="col-xs-9 col-sm-8 col-md-6">
                            accordingly.
                        </label>
          </div>
        </div>
      </div>
    </div>
    <div class="row" id="DivFooter">
      <div class="col-lg-12">
        <div class="col-lg-12">
          <div class="pull-right text-center">
            <label>
                            Regards and Respect<br />
                            from<br />
                            Dr. Jayesh Hathi
                        </label>
          </div>
        </div>
      </div>
    </div>
    <br />
    <div class="row">
      <div class="col-lg-12">
        <div class="col-xs-4">
          <input type="button" value="Save" class="btn btn-block btn-primary" id="BtnSave" />
        </div>
        <div class="col-xs-4">
          <input type="button" value="Print" class="btn btn-block btn-primary" />
        </div>
        <div class="col-xs-4">
          <input type="button" value="Cancel" class="btn btn-block btn-default" />
        </div>
      </div>
    </div>
  </div>
</form>

<div class="print">
  <div class="container">
    <div class="row">
      <div class="col-lg-12">
        <div class="col-lg-12">
          <div class="pull-right" id="PrintDate">

          </div>
        </div>
      </div>
    </div>
    <br />
    <br />
    <div class="row">
      <div class="col-lg-12">
        <div class="form-group" id="PrintDoc">

        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-lg-12">
        <div class="form-group" id="PrintData">

        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-lg-12">
        <div class="col-lg-12">
          <div class="pull-right text-center">
            <label>
                            Regards and Respect<br />
                            from<br />
                            Dr. Jayesh Hathi
                        </label>
          </div>
        </div>
      </div>
    </div>
    <br />
  </div>
</div>  

CodePen:https://codepen.io/anon/pen/GmjmBr

我想在医生名称和患者姓名等输入文本下面加下划线。我可以在预览模式下添加HTML吗?

由于我获得了数组中所有输入的价值并加入了它,我不认为我可以将HTML代码保存在数组中。

我已附上图片以便更好地澄清 enter image description here

0 个答案:

没有答案