Chances are this needs a Post Hook but I'm useless with anything like that.
I have a form, which assigns users to a usergroup on signup - this works fine - however our client has asked for another field - an 'I'm not a user field'
Overall this is fine, and to add the field and usergroup works without an issue, but then they have asked that if they select this group then it displays a text field that the user can enter data into.
So far, my form is as such
<label for="product">Product* </label>
<select name="product:required" id="product">
<option selected=""> </option>
<!-- Snipped un needed options -->
<option value="I am not a User" [[!+product:FormItIsSelected=`I am not a User`]]>I am not a User</option>
</select>
<span class="error">[[+error.product]]</span> </li>
[[+product:isequalto=`I am not a User`:then=`
<li>
<label for="not-a-user">If you are not a user please enter your product here: </label>
<input type="text" name="not-a-user:required" id="not-a-user" value="[[+not-a-user]]" />
<span class="error">[[+error.not-a-user]]</span> </li>
`:else:=``]]
<li>
Now, the above works and displays the field IF the form is submitted with one of the other fields in the form blank and causing an error, but obviously we want to do it the first time rather than by causing an error.
As i say its probably a post hook thats required but i dont know where to start.
Thnaks for any insight.