Make HTML form data unchangeable, but still able to post

forms, javascript, jquery

Solution

Give the input a readonly attribute:

`<input readonly value='cannot be changed' />`

Problem

I have an HTML form that calculates total quantity and price. I can put this total into an input field to be submitted. However, I don't want the user to be able to change it. If i put it in a div and display it, it's not submitted with the form. How do I display the total and submit it without letting the user change it? I'm probably missing something basic here. Any help appreciated.

Original source

Related problems