Block text box [closed]

0

I have a question about the blocking of a text box, what happens is that when loading the page, the text box is blocked, but when I save information and reload the page you can edit the information of the box that should be blocked As I handle hours of employee entries it is important that they can not change the time.

Here is my code:

    <input type="text" name="timePunchIn" class="timePunch timefield timeIn" id="timePunchIn" value="${iteration.startTime}" readonly="readonly"/>

I appreciate your help, regards

    
asked by Pistche Lawliet 20.11.2017 в 00:55
source

2 answers

2

DISABLED

The disabled attribute is a boolean attribute.

When present, it specifies that the element must be disabled.

A disabled input element can not be used and can not be clicked.

The disabled attribute can be configured to prevent a user from using the element until some other condition is met (such as selecting a check box, etc.). Then, a JavaScript could remove the disabled value and make the element usable.

Tip: items disabled in a form will not be sent.

    <input type="text" name="timePunchIn" class="timePunch timefield timeIn" id="timePunchIn" value="${iteration.startTime}" disabled>
    
answered by 20.11.2017 / 09:36
source
0

I have used disabled and it works.

<html>
  <body>
    <input type="text" disabled>
  </body>
</html>
    
answered by 20.11.2017 в 23:23