Jump to content

Variable not forcing else statement


Xtremer360

Recommended Posts

Okay so after echoing awardType it says Match which would mean it would go to the else part of the statement but it doesn't. It still shows the dropdown for the characters and don't know why?

 

<?php require ('php/awardsshowNom.php'); ?>
    
<script type="text/javascript" src="forms/edit/js/awardsshowNom.js"></script>

<!-- Form -->
<form action="#" id="awardsshowNomForm" >
<fieldset>
	<legend>Edit Award Nominations</legend>
        <?php echo $awardType; ?>
        <?php if ($awardType = 'Singular') { ?>
        <div class="field required">
		<label for="nominees">Nominees</label>
		<select class="dropdown" name="charactersDrop" id="charactersDrop" title="Characters Drop">
                <option value="">- Select -</option>
               <?php
                    while ( $row = mysqli_fetch_array ( $charactersResult, MYSQL_ASSOC ) ) { 
                        print "<option value=\"".$row['ID']."\">".$row['characterName']."</option>\r";
                    }
                ?>
            </select>
            <input type="button" value="Add Character" class="" onclick="HandlerCharacters()"/>
            <ul id="characterList">
            </ul>
            <span class="required-icon tooltip" title="Required field - This field is required, it cannot be blank, and must contain something that is different from emptyness in order to be filled in. ">Required</span>
        </div>
        <? } else { ?>
        <div class="field required">
		<label for="nominees">Nominees</label>
		<select class="dropdown" name="events" id="events" title="Events for <?php echo date("Y") ?>">
                <option value="">- Select -</option>
               <?php
                    while ( $row = mysqli_fetch_array ( $matchResult, MYSQL_ASSOC ) ) { 
                        print "<option value=\"".$row['ID']."\">".$row['segmentTitle']."</option>\r";
                    }
                ?>
            </select>
            <input type="button" value="Add Match" class="" onclick="AddMatch()"/>
            <ul id="matchList">
            </ul>
            <span class="required-icon tooltip" title="Required field - This field is required, it cannot be blank, and must contain something that is different from emptyness in order to be filled in. ">Required</span>
        </div>
        <?php } ?>
        <input type="hidden" name="awardID" id="awardID" value="<?php echo $awardID; ?>" />
        <input type="hidden" name="awardShowID" id="awardShowID" value="<?php echo $awardShowID; ?>" />
        <input type="hidden" name="awardName" id="awardName" value="<?php echo $awardName; ?>" />
        <input type="submit" class="submit" name="editAwardNom" id="editAwardNom" title="Edit Award Nominees" value="Edit Awards Nominees"/>
</fieldset>
</form>
<!-- /Form -->

<!-- Messages -->
<div class="message message-error">
    <h6>Required field missing</h6>
    <p>Please fill in all required fields. </p>
</div>
<div class="message message-success">
    <h6>Operation succesful</h6>
    <p>Arena was added to the database.</p>
</div>
<!-- /Messages -->

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.