Hello, I am working with a form which has a lot of text fields which submits some data via POST. I would like some of this data to ONLY be sent if the user actually has entered something in the textfield, and if the user didn't I would like that variable not to even be sent via POST (not even an empty value)... Is this possible somehow? Thanks
so there is no PHP command to tell the compiler not to even consider empty fields when (before) submitting?
But are you still allowing the form to be sent even if a user has entered nothing in a field, cause you could check whether a value exsits after the form is submitted via isset or isempty i think
In there lays the problem... unfortunately it appears that this form is so big that it is not even sent... If it were being sent I would then process $_POST with isset() or empty() but it not even being sent in the first place ($_POST is empty), which is why I want to trim down what is being sent to the minimum so that it actually is sent, you know?
Somebody told me that disabled form elements aren't sent and offered this code: however it doesn't work... am I going in the right direction?
could you provide an example? I know how to check for input in fields with JS but I am not sure how to disable fields to make them not being sent at all