• I have a tax query search set up to use radio buttons.

    <form action="<?php echo get_permalink($global_options->event_page);?>">
    
    <?php foreach( $regions as $region ) : ?>
    <label><input type="radio" name="?region=<?php echo $region->slug;?>" /><span><?php echo $region->name;?></span></input></label><br />
    <?php endforeach;?>
    
    <button type="submit" id="searchsubmit" class="btn">Search</button>

    This returns this search:
    ?%3Fregion%3Dborders=on

    However, the tax query will only work with:
    ?region=borders

    Why won’t it recognise the %3F and %3D ?

    It doesn’t like the =on when a radio button is checked either. I can’t seem to find any info on how to fix this.

Viewing 1 replies (of 1 total)
  • Thread Starter jelly_bean

    (@jelly_bean)

    Right, if you’re stuck with this and using radion buttons, like I was, the solution is with what you use for the name and value of the radio buttons.

    <?php foreach( $regions as $region ) : ?>
    <label><input type="radio" name="region" value="<?php echo $region->slug;?>" /><span><?php echo $region->name;?></span></input></label><br />
    <?php endforeach;?>

    What I have changed is the name is now name=”region” rather than name=?region=”. I have now given the radio button a value of value=”<?php echo $region->slug;?>”.

Viewing 1 replies (of 1 total)
  • The topic ‘Tax query won't recognize ? and =’ is closed to new replies.