Jump to content

j4nd3r53n

Members
  • Posts

    1
  • Joined

  • Last visited

j4nd3r53n's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I am creating a form that includes a readonly text control: <form id="attrform" name="attrform" method="post" action="/office/faces/editattributes.xhtml" enctype="application/x-www-form-urlencoded"><table><tbody><tr><td><label for="attrform:atid">ID</label></td><td><input id="attrform:atid" type="text" name="attrform:atid" readonly="readonly" /></td></tr><tr><td><label for="attrform:atname">Name</label></td><td><input id="attrform:atname" type="text" name="attrform:atname" /></td></tr></tbody></table><input type="submit" name="attrform:j_idt16" value="Save" /></form> 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?
×
×
  • Create New...