Rob
Rob

Reputation: 6380

Conditional statements not being picked up

I've read around about using conditional statements but never successfully got them to work! This is what I have:

<!--[if !(IE)]><!-->
    <input type="text" value="" placeholder="First name" name="FNAME" class="required" id="mce-FNAME">
<!--<![endif]-->
<!--[if (gt IE 6)]-->
    <input type="text" value="First name" name="FNAME" class="required" id="mce-FNAME">
<!--<![endif]-->

I want it to display the first input for every other browser except IE and the second statement to display for IE6 or greater.

At the moment when testing it initially in Chrome it's just showing them both!

Where am I going wrong?

Upvotes: 1

Views: 908

Answers (1)

BoltClock
BoltClock

Reputation: 724302

You were prematurely closing your second if (and subsequently unnecessarily reopening your second endif), which is causing all browsers to see your second input. It also needs to be gte IE 6 if you want to include IE6:

<!--[if !(IE)]><!-->
    <input type="text" value="" placeholder="First name" name="FNAME" class="required" id="mce-FNAME">
<!--<![endif]-->
<!--[if (gte IE 6)]>
    <input type="text" value="First name" name="FNAME" class="required" id="mce-FNAME">
<![endif]-->

Upvotes: 1

Related Questions