Search code examples
javascripthtmlvalidationinputmailto

Disabled input value in mailto protocol


I need to send a form via email and in this form there is a text input that needs to be disabled so that it cannot be modified. Can i put it's value in the email or do i have to enable?

Here is the code:

Punteggio attuale:&nbsp; <input type="text" disabled id="punteggio_" name="Punteggio registrato "> <button type="button" onclick="punti()">Aggiorna punteggio</button>


Solution

  • You could probably use the readonly attribute:

    <input readonly value="whatever" />
    

    But yes, to have its value be submitted the input must not be disabled, since a disabled input is considered 'unsuccessful.'