Jump to content

Form module or How would you do it?


csaeum
 Share

Recommended Posts

Hello I am looking for Gerde a way convenient to create a contact form and submit this via email and or perhaps even to save to a file or table.

As 2nd I'm still looking for a way a form on a separate page to address this but by PW validate directly.
My newsletter senders Newsletter2Go offers here a form directly (you can embed the code directly) I would just recreate the form in order to respond to errors and only submit if it fits.

How would you do it?
I thought at first with SimpleForm can something but the project is something else.
The API way I still do not understand properly. Therefore, the question of how you do it, or if there is another module for this purpose!

Greetings and thank you

Link to comment
Share on other sites

The easiest way will be to buy the Pro forms module: http://modules.processwire.com/modules/form-builder/

Otherwise there is this free module: http://modules.processwire.com/modules/form-template-processor-mailer/

Or if you want complete control, start reading about processing forms via the API here: https://processwire.com/talk/topic/2089-create-simple-forms-using-api/ - with this you can do anything you want, but you'll have to get your hands dirty :)

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Ok thank you've looked at the free module times but to me it is still too little in the control well is it for 2.2.

I want to remain flexible and secure update. That's just my problem in the existing CMS system.

Where can I find a small form which is reacted with the API. This should be an email entered by the data.

Since I'm not a developer (but trainable) tells me the API very little.

Thank you for your help.

Link to comment
Share on other sites

Ok I've been through some forum posts savvy as I am building a form.

Unfortunately, the output content is no longer compatible with the ZURB Foundation Framework.

Therefore, I have seen in a further contribution that you can generate each field installation without the additional content.

In this post, it is shown how it is implemented and not a bug and not a box appears with me.

<?php "<div class='row'>" . $form->get('email')->render() . "<div>" ?>

Is this approach correct?
Or it must be implemented differently.

<form action="./kontakt/" method="post">
                    <div class="row">
                        <div class="small-12 medium-12 large-12 columns">
                            <div class="input-group">
                                <span class="input-group-label">Name</span>
                                <input class="input-group-field" type="text">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="small-12 medium-12 large-12 columns">
                            <div class="input-group">
                                <span class="input-group-label">E-Mail</span>
                                <input class="input-group-field" type="email">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="small-12 medium-12 large-12 columns">
                            <div class="input-group">
                                <span class="input-group-label">Telefon</span>
                                <input class="input-group-field" type="tel">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="small-12 medium-12 large-12 columns">
                            <div class="input-group">
                                <span class="input-group-label">Nachricht</span>
                                <textarea class="input-group-field" type="text"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="small-12 medium-12 large-12 columns">
                            <input type="submit" class="button" value="Submit">
                        </div>
                    </div>
                </form>

My form should look like at the end so the fields and should when it comes to integrated via API.

Thanks for your patience and assistance

Link to comment
Share on other sites

ok here is my solution to this time:
 

                <form action="./kontakt/" method="post">
                    <div class="row">
                        <div class="small-12 medium-12 large-12 columns">
                            <div class="input-group">
                                <span class="input-group-label">Name</span>
                                <?php
                                    $field = $modules->get("InputfieldText");
                                    $field->attr('id+name','klientname');
                                    $field->attr('type','text');
                                    $field->attr('class', 'input-group-field');
                                    $field->attr('placeholder', 'Max Mustermann');
                                    $out = $field->render();
                                    echo $out;
                                ?>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="small-12 medium-12 large-12 columns">
                            <div class="input-group">
                                <span class="input-group-label">E-Mail</span>
                                <?php
                                    $field = $modules->get("InputfieldText");
                                    $field->attr('id+name','klientemail');
                                    $field->attr('type','email');
                                    $field->required = 1;
                                    $field->attr('class', 'input-group-field');
                                    $field->attr('placeholder', 'Max@Mustermann.de');
                                    $out = $field->render();
                                    echo $out;
                                ?>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="small-12 medium-12 large-12 columns">
                            <div class="input-group">
                                <span class="input-group-label">Telefon</span>
                                <?php
                                    $field = $modules->get("InputfieldText");
                                    $field->attr('id+name','klienttel');
                                    $field->attr('type','tel');
                                    $field->attr('class', 'input-group-field');
                                    $field->attr('placeholder', '+49 9876 54321');
                                    $out = $field->render();
                                    echo $out;
                                ?>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="small-12 medium-12 large-12 columns">
                            <div class="input-group">
                                <span class="input-group-label">Nachricht</span>
                                <?php
                                    $field = $modules->get("InputfieldTextarea");
                                    $field->attr('id+name','klientmessage');
                                    $field->attr('type','text');
                                    $field->attr('class', 'input-group-field');
                                    $field->attr('placeholder', 'Ihre Nachricht an mich');
                                    $out = $field->render();
                                    echo $out;
                                ?>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="small-12 medium-12 large-12 columns">
                            <?php
                                $field = $modules->get("InputfieldSubmit");
                                $field->attr('id+name','submit');
                                $field->attr('value','Nachricht senden');
                                $field->attr('class', 'button');
                                $out = $field->render();
                                echo $out;
                            ?>
                        </div>
                    </div>
                </form>

Now the question is how can I email so arrive this data with me.

In a further expansion step, it should be perhaps stored in a database table.

Link to comment
Share on other sites

I believe in my last post that is not coming over like this.

Would you also make the form so or not? Or should it create directly without access to the API, but would have to be the same right?

Yesterday I wire mail yet installed. When I validate the fields on the Foundation ZURB Framework by CSS (right inputs) and then dispatch and then this einpacke in a mail via Wire mail, then surely it should be good right?

Or should I check it again and only then passed to Wire mail. Has anyone even tips or a HowTo for me?

Thanks, people ;)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...