javascript within an email?

How do I handle this? I created a family registration form in Wordpress. When the form is submitted an email-notice is sent to me. The email is html and contains a table. Each row contains several fields pertaining to a family member such as first name, last name and so on. The question is how do I hide the table rows that contain empty  data in the email.

Can you use javascript in an html email? Wrap a <tr><td>{first name}</td><td>{last name}</td></tr> within a <script> and precede the row with an if condition? If {first name} is empty do nothing else print?

The form can hold up to 10 family members and in the webpage I hide all the fields except for the first family member. Then at the end of the first member I ask if they would like to enter another family member. If they say yes the next family member questions becomes visible. This keeps the web form from becoming overwhelming. But the email-notice shows all the members including empty member table rows.
How do I clean up the email?
Gary SamuelsPlant ManagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
No, you can't use javascript in an email.  None of the current email clients will run javascript.
Dave, posted the answer to the reason why you are having issues.
The disabling of running dynamic content within the email client context deals with how they were compromised to send out spam, etc.

The remedy to your situation is the email should have a link back to a web page that will load the data and display it within the web browser context which will retain the ability to run JavaScript and interact with your data.
I.e. The process creates a unique identifier that will be stored/available within the database table designated for this purpose. Once you go to the link/validate with the access, you will get the display as you currently have in the email but in this context it will work.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.