E
evachick156
Guest
Here is my HTML:
if(!($rows['method'] === "undefined"))
{
echo ("<select class=\"train\" name=\"actualSolution\" id='" . $rows['id'] . "_actual'>");
echo("<option disabled value='" . $rows['id'] . "'>" . $rows['method'] . "</option>");
?>
</select>
<?
}
else
{
echo ("<select class=\"train\" name=\"actualSolution\" id='" . $rows['id'] . "_actual'>");
echo("<option></option>");
?>
</select>
<?
}
?>
My goal is when it hits the ELSE in my if statement i want to check that in my javascript for example:
if(selectActual.options[0] == "")
{
select.options[0] = new Option(outcome, x);
select.options[1] = new Option(b1, x);
select.options[2] = new Option(b2, x);
select.options[3] = new Option(b3, x);
select.options[4] = new Option(b4, x);
select.options[5] = new Option(b5, x);
select.options[6] = new Option(b6, x);
select.options[7] = new Option(b7, x);
select.options[8] = new Option(b8, x);
select.options[9] = new Option(b9, x);
}
If I do hit the else than I want to fill with the above code. But it doesnt hit it. It must be my if statement but how do i check to see if there isnt no "option"?
Ok....so where I have my if statement....I will end up going to the else which has:
<option></option>
In my javascript I want to make sure that I have hit my else by checking to see if its empty (" ") if it is, than i want to fill it with stuff.
However, if i hit the if and dont go to the else, than i dont want to hit that if statement in my javascript.
if(!($rows['method'] === "undefined"))
{
echo ("<select class=\"train\" name=\"actualSolution\" id='" . $rows['id'] . "_actual'>");
echo("<option disabled value='" . $rows['id'] . "'>" . $rows['method'] . "</option>");
?>
</select>
<?
}
else
{
echo ("<select class=\"train\" name=\"actualSolution\" id='" . $rows['id'] . "_actual'>");
echo("<option></option>");
?>
</select>
<?
}
?>
My goal is when it hits the ELSE in my if statement i want to check that in my javascript for example:
if(selectActual.options[0] == "")
{
select.options[0] = new Option(outcome, x);
select.options[1] = new Option(b1, x);
select.options[2] = new Option(b2, x);
select.options[3] = new Option(b3, x);
select.options[4] = new Option(b4, x);
select.options[5] = new Option(b5, x);
select.options[6] = new Option(b6, x);
select.options[7] = new Option(b7, x);
select.options[8] = new Option(b8, x);
select.options[9] = new Option(b9, x);
}
If I do hit the else than I want to fill with the above code. But it doesnt hit it. It must be my if statement but how do i check to see if there isnt no "option"?
Ok....so where I have my if statement....I will end up going to the else which has:
<option></option>
In my javascript I want to make sure that I have hit my else by checking to see if its empty (" ") if it is, than i want to fill it with stuff.
However, if i hit the if and dont go to the else, than i dont want to hit that if statement in my javascript.