Tuesday, 6 August 2013

PHP Form - Hide one field if another field is empty

PHP Form - Hide one field if another field is empty

I need to do something pretty simple.
I have a PHP Form with multiple fields. One field is named 'firstname',
and the other is named 'product'.
When a user attempts to complete the form, I need the 'product' field to
be hidden IF the 'firstname' field has not been completed by the user.
I have tried some code to make this work, but everything I have found is
related to querying the database for the record to see if the field is
empty; However, in this scenario, no data exists in the database field
because the form hasn't been submitted yet.
Any help would be greatly appreciated!
Thanks! =0)

No comments:

Post a Comment