Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created December 11, 2011 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaindooley/1458219 to your computer and use it in GitHub Desktop.
Save iaindooley/1458219 to your computer and use it in GitHub Desktop.
Subtractive Logic in Template Animation
<form>
<dl class="error" id="whatevsError">
<dt>You have to do something about this</dt>
<dd>The reason we ask you do do this is so that we can laugh all the way to the bank</dd>
</dl>
<dl>
<dt><label for="whatevs">Whatevs:</label</dt>
<dd><input type="text" name="whatevs" id="whatevs" /></dd>
</dl>
</form>
To render this using PHP you might do something this:
$dom = $this->loadDocument($my_template);
if(!checkFormError('whatevs'))
$dom->getElementById('whatevsError')->parentNode->removeChild($dom->getElementById('whatevsError'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment