Ignore Input Fields that contain Placeholder Text


I have 3 sets of 4 input fields that I want the user to complete and submit to my site.
I have an $all variable that I am storing the data inside.

However, if any input fields aren’t completed, then I’d like to remove the placeholder text from the $all variable.

Currently my output (var_dump) for completing the first row is:

string '1|1|1|1

Height (cm)|Width (cm)|Length (cm)|Weight (kg)

Height (cm)|Width (cm)|Length (cm)|

' (length=133)

However, I’d like it to be:

string '1|1|1|1' (length=7)

Here is my current code on Pastebin: http://pastebin.com/2Je75vN0

As you can see, placeholder text is placed inside the field using javascript and the title attribute.

Can a very nice and gifted person please point me in the right direction with this?

Or should I perhaps be using Javascript to validate this?

Many thanks for any pointers.

After a quick Google, I’ve just found this link: http://www.cssnewbie.com/example/placeholder-support/

It means I can use the placeholder element and force it on ye olde browsers.

I will post back if resolved.