I’m using wordpress for a project and I have notice an unusual condition paradox.
<li class="<?php echo (isset($_REQUEST['search']) && $_REQUEST['search']!='opportunities')? 'active':''; ?>"><a href="#tabs-1" >People</a></li>
<li class="<?php echo (isset($_REQUEST['search']) && $_REQUEST['search']=='opportunities')? 'active':''; ?>"><a href="#tabs-2">Opportunities</a></li>
so when I submit a form, i’m getting the following.
$_POST['search'] =>'opportunities'
this is illogical for me to figure it out, just wondering if someone has come across this, and might help.
UPDATE: sorry my bad…
this is what I get back
<li class="active"><a href="#tabs-1" >People</a></li>
<li class="active"><a href="#tabs-2">Opportunities</a></li>
This is the paradox, how can they both have active classes??
I have used $_POST as well instead of $_REQUEST just for the record.
Update 2
After some more testing, and head banging moments later…
this paradox only happens when the $_POST['search']='opportunities'
This is just me being stupid, and my browser being toooooo fast that it seems,
problem was on a jquery script that automatically makes the first tab active, hence why they are both active…and that was not done by me which explains it all…
$('.tabs li').eq(0).addClass('active');thank you guys, sometimes simple things, like this, make you wanna scream 🙂