I have a piece of PHP code that tells me if something happened or not. Based on the result I want to be able to display some HTML fields. I know I can achieve this in javascript/jQuery however I don't think breaking up the PHP code with javascript is a good idea for ease of reading.
What is the best way to achieve this?
EXAMPLE:
<?php
$result = 1;
if (result == 1)
{
display some html input fields where
} else
{
hide some html input fields
}
?>
Thanks in advance.