I am using eForm to add, update and delete some database records. In each case, there is a function that is called once the form is submitted which performs the relevant SQL operation.
In order to correctly update and delete, I need to take the record key and then use that in the post-submit function that gets called, but I don’t want this to be visible to the user or to take up any real estate in the form.
If it is stored in a hidden field, then the form processing gets derailed. I can put it in a readonly field but that takes up space.
I’m probably missing something very obvious, but if anyone can point me to a solution, I’d be appreciative. FWIW, here’s an example of the eform call for the update function:
[!data_parsing_functions!]
[!eForm? &noemail=`true` &protectSubmit=`0` &tpl=`eformdata_chunk` &formid=`DataForm` &eFormOnBeforeFormParse=`populateDataForm` &eFormOnBeforeMailSent=`updateDatabaseEntry` &thankyou=`success_chunk` &allowhtml=`0`!]
And here’s what the currently-offending section of form code looks like :
<input type="text" name="internalKey" value="[+internalKey+]" readonly="true"/><br />
<label for="coName">Member Name:*
<input name="fullname" id="coName" type="text" value="[+fullname+]" size="30" eform="Member Name::1:"/>
"internalKey" is what gets pulled from the database by the function "populateDataForm". I’d like to have it available to the "updateDatabaseEntry" function without it being carried through the form or visible.
Any thoughts would be appreciated. And apologies in advance if the solution should be easy to find or obvious - I just happen to be too far down a rabbit hole at the moment!
MattC