I have a form that has cloned form elements in it. The form submits to e-mail. The problem I am having is that 开发者_高级运维when a user lets say changes their mind and removes a cloned form element block and submits the form, the cloned form element that they removed shows up in the email output. How can I get it so that removed element(s) do not show up in the e-mail output?
The form is here: http://www.pentco.com/test.php
I've duplicated and commented out the php code that's used to process the form at the beginning of the page source so that it remains visible when viewing the source and does not get compiled.
Any illumination is greatly appreciated.
That is because your javascript for Removing the item is only hiding the element - not removing it. This keeps all the form elements within the document and allows them to be submitted.
As Chris pointed out, you are .hide()
-ing an element, when you really should .remove()
it.
精彩评论