how to check if somthing has been enter into a field by if statement
-
Ok I have a drop down box and I’m using the more fields plugin for word press to print out a https:// address that is entered on the post screen. The more fields plugin gives this code to print out the custom text field.
<?php meta('guys'); ?>
I need to check the custom fields to see if a address has been entered. If one has been entered it will show the in the drop down if not it will not show it. here is my code.
<form name="jump" > <p align="left"> <select name="menu" style="width: 260px;"> <?php if(class_exists( 'guys') && meta('guys')) :?> <option value="<?php echo meta('guys'); ?>">GUYS</option> <?php endif; ?> <?php if(class_exists( 'girls') && meta('girls')) :?> <option value="<?php echo meta('girls'); ?>">Girls</option> <?php endif; ?> <?php if(class_exists( 'other') && meta('other')) :?> <option value="<?php echo meta('other'); ?>">GUYS AND GIRLS</option> <?php endif; ?> </select> <input type="button" onClick="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO" style="padding: 0px 5px;"> </p> </form>
for some reason its not working even when i enter text for the field nothing shows up ?
- The topic ‘how to check if somthing has been enter into a field by if statement’ is closed to new replies.