So i’m trying to use phx in my form to output a class if there’s an error message on submit, but it’s not working.
here’s my code
[[!FormIt? ]]
<p id="validation">[[+fi.error.error_message]]</p>
<form method="post" action="[[~[[*id]]]]">
<p class="info">Fields marked with a <span class="required">*</span> are required.</p>
<ul>
<li>
<label for="title">Title </label>
<select name="title">
<option value="" selected="selected"></option>
<option value="Mr" >Mr</option>
<option value="Mrs" >Mrs</option>
<option value="Miss" >Miss</option>
<option value="Dr" >Dr</option>
</select>
</li>
<li[[+fi.error.name:notempty=` class="error"`]]>
<label for="name">Name <span class="required">*</span></label>
<input type="text" name="name:required" value="[[+fi.name]]" />
</li>
<li[[+fi.error.house:notempty=` class="error"`]]>
<label for="House">House # <span class="required">*</span></label>
<input type="text" name="house:required" value="[[+fi.house]]" />
</li>
<li[[+fi.error.postcode:notempty=` class="error"`]]>
<label for="postcode">Postcode <span class="required">*</span></label>
<input type="text" name="postcode:required" value="[[+fi.postcode]]" />
</li>
<li>
<label for="tel">Telephone</label>
<input type="text" name="tel" value="[[+fi.tel]]" />
</li>
<li>
<label for="mobile">Mobile</label>
<input type="text" name="mobile" value="[[+fi.mobile]]" />
</li>
<li[[+fi.error.email:notempty=` class="error"`]]>
<label for="email">Email</label>
<input type="text" name="email:email" value="[[+fi.email]]" />
</li>
<li>
<label for="query-type">Sale/Let</label>
<select name="query-type">
<option value="" selected="selected"></option>
<option value="sale">Sale</option>
<option value="let">Let</option>
</select>
</li>
<li[[+fi.error.comments:notempty=` class="error"`]]>
<label for="comments">Comments</label>
<textarea name="comments:required:stripTags">[[+fi.comments]]</textarea>
</li>
<li>
<input type="checkbox" name="financing" value="1" [[+fi.financing:notempty=`checked="checked"`]] />
<label for="financing">Financial advice requested</label>
</li>
<li>
<input type="submit" name="submit" value="Submit" />
</li>
</ul>
</form>
i didn’t add anything to the formit call yet as i haven’t gotten that far. the form validates fine, but it seems like the phx calls aren’t working.
do i need to add phx to my modx revolution install somewhere? i looked around and haven’t seen anything to indicate that it’s not included already in revo.