Loading...

components

PHP ajax Forms

Nirvana has a built-in universal php-ajax form that can grab dynamic amounts of inputs and send it to any given email address. To make the form work, simply add the class .zformlike <form class="zform">.

You can also specify where to send the data via an hidden input:

<input type="hidden" name="to" value="username@domain.extension"/>
Other reserved name fields are: subject, email, name

See the sample code under the form bellow for better understanding.

HTML
<form class="zform" method="post">
	<div class="form-group">
		<input class="form-control" type="hidden" name="to" value="username@domain.extension">
	</div>
	<div class="form-group row">
		<label class="col-md-2 col-form-label text-md-right">Name :</label>
		<div class="col-md-10">
			<input class="form-control" type="text" name="name" required>
		</div>
	</div>
	<div class="form-group row">
		<label class="col-md-2 col-form-label text-md-right">Subject :</label>
		<div class="col-md-10">
			<input class="form-control" type="text" name="subject" required>
		</div>
	</div>
	<div class="form-group row">
		<label class="col-md-2 col-form-label text-md-right">Email :</label>
		<div class="col-md-10">
			<input class="form-control" type="email" name="from" required>
		</div>
	</div>
	<div class="form-group row">
		<label class="col-md-2 col-form-label text-md-right">Field One :</label>
		<div class="col-md-10">
			<input class="form-control" type="text" name="field-1" placeholder="Optional">
		</div>
	</div>
	<div class="form-group row">
		<label class="col-md-2 col-form-label text-md-right">Field Two :</label>
		<div class="col-md-10">
			<input class="form-control" type="text" name="field-2" placeholder="Optional">
		</div>
	</div>
	<div class="form-group row">
		<label class="col-md-2 col-form-label text-md-right">Message :</label>
		<div class="col-md-10">
			<textarea class="form-control" rows="8" name="message" placeholder="Write your message here..."></textarea>
		</div>
	</div>
	<div class="form-group row">
		<div class="col-md-10 offset-2">
			<input class="btn btn-primary" type="submit" name="submit" value="Send!">
		</div>
	</div>
	<div class="zform-feedback"></div>
</form>

(212) 123-4567
666 Unnamed ave, california
nirvana@abc.com

powered by Themewagon