php if elseif then what?
<p>This is my PHP code</p>

<p>The problem points I have mentioned in comments inside the code portion</p>

<pre><code>if(isset($_POST['submit']))
{
    if(isset($_POST['rdoption1']))
    {
        $var1 = $_POST["rdoption1"];
    }
    if(isset($_POST['rdoption2']))
    {
        $var2 = $_POST["rdoption2"];
    }
    if(!isset($_POST['rdoption1']))
    {
        $message = "Please select Option1";
    }
    elseif(!isset($_POST['rdoption2']))
    {
        $message = "Please select Option2";
    }
    elseif($_POST['rdoption2'] == "checkSetXY")
    {
        if($_POST["valXLocation"] == "")
        {
            $message = "You forget to enter X value.";
        }
        elseif($_POST["valYLocation"] == "")
        {
            $message = "You forget to enter Y value.";
        }
    } // till here all is good. I get all error messages if anything is left vacant or not clicked on radio button
    elseif(empty($_POST['txtoption3'])) //this is not working //the issue is if i select rdoption1  any option and rdoption2 checkDefault next code logic work.. but next code logic does not work when i click on the radio of checkSetXY and enter x and y values.. It simply does not execute code further..
    {
        $message = "Please enter your name.";
    }
                else
    {               
        //insert into db
                 }
       }
</code></pre>

<p>This is html form with PHP echos
Here I'm getting messages where they shall be but not when I select <code>checkSetXY</code> value</p>

<pre><code>        &lt;?php if(!empty($message)){ echo $message; } ?&gt;

        &lt;form id="form1" name="form1" method="post" action="form1.php"&gt;

          Space portion:
              &lt;input type="radio" name="rdoption1" value="RJ"/&gt;space 1
              &lt;input type="radio" name="rdoption1" value="SM" /&gt;space 2


            Pixel Location
                &lt;div class="formText"&gt;
                &lt;input type="radio" name="rdoption2" value="checkSetXY"/&gt; Specify Location
                    X: &lt;input type="text" id="locField" name="valXLocation"&gt;  
                    Y: &lt;input type="text" id="locField" name="valYLocation"&gt; 
                &lt;input type="radio" name="rdoption2" value="checkDefault"/&gt;Default

                &lt;input type="text" class="input" name="txtoption3"&gt;
                &lt;input type="submit" name="submit" value="Submit"&gt; 
           &lt;/form&gt;
</code></pre>

<p>Now I'm confused why is it not taking <code>elseif</code> of <code>txtoption3</code></p>

<p>Any help? Thanks in advance</p>
