Last active
August 29, 2015 14:02
-
-
Save goldsky/d5204e524eb55510a9b4 to your computer and use it in GitHub Desktop.
Page 1 of dynamic field for FormIt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[!FormIt? | |
&hooks=`redirect` | |
&store=`1` | |
&redirectTo=`9` | |
&validate=`name:required, | |
telephone:required` | |
&submitVar=`go` | |
]] | |
[[!+fi.error_message:notempty=`<p>[[!+fi.error_message]]</p>`]] | |
<form action="[[~[[*id]]]]" method="post" class="form-horizontal" role="form"> | |
<fieldset> | |
<legend>Personal Details</legend> | |
<div class="form-group"> | |
<label for="name" class="col-sm-2 control-label">Name</label> | |
<div class="col-sm-4"> | |
<input | |
name="name" | |
id="name" | |
type="text" | |
value="[[!+fi.name]]" | |
placeholder="Name (required)" | |
required="required" | |
class="form-control required" | |
> | |
<div class="validate">[[!+fi.error.name]]</div> | |
</div> | |
</div> | |
<div class="form-group"> | |
<label for="telephone" class="col-sm-2 control-label">Telephone</label> | |
<div class="col-md-4"> | |
<!-- [[- this snippet will render back the dynamic fields if the submission returns fail ]] --> | |
[[!fiDynamicFields? | |
&itemTpl=`step1DynamicFields.item` | |
&wrapperTpl=`step1DynamicFields.wrapper` | |
]] | |
<button | |
type="button" | |
class="btn btn-warning btn-sm" | |
onclick="addRow(this);" | |
> | |
<span class="glyphicon glyphicon-plus"></span> Click to add more | |
</button> | |
<div class="validate">[[!+fi.error.telephone]]</div> | |
</div> | |
</div> | |
| |
<div class="row"> | |
<div class="col-md-4 col-md-offset-2"> | |
<input | |
type="submit" | |
name="go" | |
class="btn btn-success btn-sm" | |
value="Submit" | |
> | |
</div> | |
</div> | |
</fieldset> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment