Disabling an input field in a form and sending data

Sometimes we need to fill an input field and disable it from the user editing. You can use the disabled attribute but when you submit the form that field will not be sent.

Then the solution is to use the readonly attribute:

<input readonly="readonly" type="text" />

readonly attribute disables the field but will not prevent it to be sent.

  • Logx

    I want submit value of input text but I don’t want user (is me) can change my value.Now I know how I can’t submit value of input text !
    Your tips saved my life.

Categories

Category BootstrapCategory CoffeescriptCategory DrupalCategory GravCategory HTMLCategory JavascriptCategory JoomlaCategory jQueryCategory LaravelCategory MagentoCategory PHPCategory SharePointCategory SpringCategory ThymeleafCategory WordPressCategory Workflow

Comments

Developed and designed by Netgloo
© 2019 Netgloo