As I understood it, when I click the submit, all the "successful controls" should be posted to the server. Under the form I have a table of data, and I use Javascript to set the values of the form - this works fine, but the readonly field (name="attrform:atid") isn't included - I have captured the packet in wireshark.
At the backend I use the value of this field to determine whether I update or insert - in the database, the ID field has the AUTO_INCREMENT attribute, which means it generates a new value if that field is NULL on insert. So, I rather need this to work: the user can create a new record by entering values in the form, and they can change an existing row by clicking on it in the table; but I can't allow the user to change the ID field manually. Is there a way to get this to work?
Submittable readonly field?
in HTML/XHTML
Posted
I am creating a form that includes a readonly text control:
As I understood it, when I click the submit, all the "successful controls" should be posted to the server. Under the form I have a table of data, and I use Javascript to set the values of the form - this works fine, but the readonly field (name="attrform:atid") isn't included - I have captured the packet in wireshark.
At the backend I use the value of this field to determine whether I update or insert - in the database, the ID field has the AUTO_INCREMENT attribute, which means it generates a new value if that field is NULL on insert. So, I rather need this to work: the user can create a new record by entering values in the form, and they can change an existing row by clicking on it in the table; but I can't allow the user to change the ID field manually. Is there a way to get this to work?