-1

I'm Trying to create a custom contact form in Joomla 3, the reason is I didn't found such big contact form. Can somebody tell me how to do it?

html:

<div class="col-lg-12">
<form role="form" method="POST" style="margin-top: 2.7em;" action="">
<div class="row">
<div class="form-group col-lg-4">
<label for="input1">Name</label>
<input type="text" name="contact_name" class="form-control" id="input1">
</div>
<div class="form-group col-lg-4">
<label for="input2">Mail</label>
<input type="email" name="contact_email" class="form-control" id="input2">
</div>
<div class="form-group col-lg-4">
<label for="input3">Phone</label>
<input type="phone" name="contact_phone" class="form-control" id="input3">
</div>
<div class="form-group col-lg-4">
<label for="input1">Dropdown</label>
<select class="form-control" name="bud">
                            <option value="a">parterowy</option>
                            <option value="b">piętrowy</option>
                            <option value="c">bliźniak</option>
                            <option value="c">mieszkalny</option>
                            <option value="c">niemieszkalny</option>
                        </select>
                    </div>
                    <div class="form-group col-lg-4">
                        <label for="input2">Size</label>
                        <input type="email" name="contact_email" class="form-control" id="input2">
                    </div>
                    <div class="form-group col-lg-4">
                        <label for="input3">Garage</label>
                        <select class="form-control" name="garaz">
                            <option value="a">wolnostojący</option>
                            <option value="b">w budynku</option>
                            <option value="c">jednostanowiskowy</option>
                            <option value="c">wielostanowiskowy</option>
                        </select>
                    </div>
                    <div class="clearfix"></div>
                    <div class="form-group col-lg-12">
                        <label for="input4">Msg</label>
                        <textarea name="contact_message" class="form-control" rows="6"id="input4"></textarea>
                    </div>
                    <div class="form-group col-lg-12">
                        <input type="hidden" name="save" value="contact">
                        <button type="submit" class="btn btn-default">Send</button>
                    </div>
                </div>
            </form>

        </div>

JS FIDDLE HERE

I read that i need to create a custom component or build another, which one is the better option?

  • Even though I'm an advanced Joomla programmer, for limited use cases like this I use a free 3rd party extension like ChronoForms. It handles everything including email post submission. If you're still interested in programming a solution yourself I can post a high level over view. – Brian Bolli Sep 17 '14 at 22:54
  • I went through this too, and I am really surprised no one answers the question, just advertisements for various existing Joomla extensions. Even the "excellent" tutorial mentioned isn't really addressing forms in any way. However, there is an example showing how to build a small module with a form at Github, Hello Ajax World Module – Olaf Dietsche Mar 1 '17 at 16:43
3

I have recently encounters an extension JxiForms which is pretty unique in its functionality.

You should give it a try if you need complete control over the form data.

It does not interfere in the form creation and handles form data processing when form is submitted.

With this extension you are totally free to place your form code, no additional script is injected.

But yes it is not for beginners.

You can check this link for details.

2

Why do you waste your time writing code for a contact form? There are a lot of Joomla forms extensions available. Fabrik is such an example. You can create as many fields as you like. Visforms is another example.

2

Yet another suggestion for an existing Extension...the work has already been done for you by 74 different developers at the JED Contact Forms section. They range from very simple to very complexed, and many are very highly rated.

If for some unbeknownst reason these don't meet your needs and you feel it necessary to build your own, I'd suggest Component Creator. Its a great introduction to Joomla coding, and the free version is perfect in your case. It allows a single-table component to be built, and the complete installation file to be generated from scratch within a few moments of you completing the table.

1

The best way to implement your custom contact form would probably be to build a Joomla . This is (IMO) the easiest extension to create, and you'll find an excelent tutorial at Joomla! Docs. There's also a nice Module Generator that helps you create and download an empty module, all you have to do is add your own code.

That being said, I think you'd be better off using a 3rd party form creator, like Brian suggested in his comment. There are many free and commercial extensions. BreezingForms, RS Forms and ChronoForms are just a couple of your options. More can be found at the Joomla! Extensions Directory.

These tools are quite easy to use, very powerfull, and has good support if you run into a problem. They are not specifically made for Contact forms, and therefore are very flexible with lots of options, allowing you to customize the form to fit your exact needs. Personally I've used BreezingForms a lot, creating both simple contact forms and advanced, multi-page questionnaires with advanced functions.

Don't reinvent the wheel...

Don't reinvent the wheel

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.