dpt62283 2016-10-28 02:45
浏览 70

如何更改html错误消息验证的位置

Having trouble in the html validation because of how its position tried removing table and resizing the input text box still the same out of position

enter image description here

addform.php

here is the form tried to resize the input textbox but still the error validation message is still out of position

   <style type="text/css">
  #dis{
   display:none;
  }


  </style>




    <div id="dis">
    <!-- here message will be displayed -->
    </div>


 <form method='post' id='emp-SaveForm' action="#">

<table class='table table-bordered'>

    <tr>
        <td>First Name</td>
        <td><input type='text' name='fname' class='form-control' 
        pattern ="[a-zA-Z]+"
        title="First Name should only contain letters"


         required /></td>

    </tr>

    <tr>
        <td>Last Name</td>
        <td><input type='text' name='lname' class='form-control'  required></td>
    </tr>

    <tr>
        <td>Contact Number</td>
        <td><input type='number' name='contactnum' class='form-control'  required></td>
    </tr>

     <tr>
        <td>Email</td>
        <td><input type='email' name='email' class='form-control' required /></td>
    </tr>

     <tr>
        <td>Password</td>
        <td><input type="password" name='pass' class='form-control'  required /></td>
    </tr>

     <tr>
        <td>Language</td>
        <td><input type='text' name='lang' class='form-control'  required /></td>
    </tr> 
    <tr>
        <td colspan="2">
        <button type="submit" class="btn btn-primary" name="btn-save" id="btn-save">
        <span class="glyphicon glyphicon-plus"></span> Save this User
        </button>  
        </td>
    </tr>

</table>

still new in doing front end hope you can help me thanks

  • 写回答

1条回答 默认 最新

  • dongxu198714 2016-10-28 02:50
    关注

    I think it needs a position:absolute, then you can move it anywhere you'd like on the page.

     #dis {
           position: absolute;
           margin-left: auto;
           margin-right: auto;
        }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏