Forums

Custom Form Code and Email settings

Castor 09 Nov, 2009
Hello guys
I am using Chrono Forms and it's best form component i've ever seen!
But now i have a problem: I use my custom Form code
<fieldset class="kontaktteil">
  <legend>Persönliche Angaben</legend>
  <div class="reihe">
    <span class="label">Name <span>*</span></span>
    <span class="feld"><input type="text" name="name" class="defbreite"
      size="15" /></span>
  </div>

  <div class="reihe">
    <span class="label">Vorname <span>*</span></span>
    <span class="feld"><input type="text" name="vorname" class="defbreite"
      size="15" /></span>
  </div>

  <div class="reihe">
    <span class="label">Strasse</span>
    <span class="feld"><input type="text" name="strasse" class="defbreite"
      size="15" /></span>
  </div>

  <div class="reihe">
    <span class="label">PLZ/Ort</span>
    <span class="feld"><input type="text" name="plz" class="plz"
      size="3" />
      <input type="text"  name="ort" class="ort"
      size="8" /></span>
  </div>

  <div class="reihe">
    <span class="label">Land</span>
    <span class="feld"><input type="text" name="land" class="defbreite"
      size="15" /></span>
  </div>

   <div class="reihe">
    <span class="label">Telefon <span>*</span></span>
    <span class="feld"><input type="text" name="telefon" class="defbreite"
      size="15" /></span>
  </div>

   <div class="reihe">
    <span class="label">Mobiltelefon</span>
    <span class="feld"><input type="text" name="mobiltelefon" class="defbreite"
      size="15" /></span>
  </div>

  <div class="reihe">
    <span class="label">E-Mail <span>*</span></span>
    <span class="feld"><input type="text" name="email" class="defbreite" /></span>
  </div>
</fieldset>

<fieldset class="kontaktteil">
  <legend>Angaben zur Erbschaft</legend>
  <div class="reihe">
    <span class="label">Name Erblasser</span>
    <span class="feld"><input type="text" name="erblassername" class="defbreite"
      size="15" /></span>
  </div>

  <div class="reihe">
    <span class="label">Vorname Erblasser</span>
    <span class="feld"><input type="text"  name="erblasservorname" class="defbreite"
      size="15" /></span>
  </div>

  <div class="reihe">
    <span class="label">Todestag</span>
    <span class="feld"><input type="text" name="erblassertodestag" class="defbreite"
      size="15" /></span>
  </div>

  <div class="reihe">
    <span class="label">Wohnort Erblasser</span>
    <span class="feld"><input type="text" name="erblasserwohnort" class="defbreite"
      size="15" /></span>
  </div>

  <div class="reihe">
    <span class="label">Erbquote</span>
    <span class="feld"><input type="text" name="erbquote" value="in %" class="defbreite"
      size="15" /></span>
  </div>
</fieldset>


<fieldset class="kontaktteil">
  <legend>Weitere Mitteilungen</legend>
  <div class="reihe">
    <span class="feld">
      <textarea class="mitteilung" name="mitteilung" cols="40" rows="8"></textarea>
    </span>
  </div>
</fieldset>
    <input class="knopf" type="submit" value="Absenden" />
<p class="rot">* Pflichtfelder</p>


That works good but now i have a problem with the Email Settings.
I Want the information filled in by the site visitors to be sent to the email. So I set an e-Mail Adress and also put some "dynamic name" and "dynamic from" to enable the Email. But because i use my own html dynamic from and dynamic name doesn't make any sense and are removed autmoatically. As a result email is disabled again.

What can I do to enable the Email function and sending all filled information?
THX for your help guys :-)
GreyHead 09 Nov, 2009
Hi Castor,

It should still work OK. You need to put a valid input name in the Dynamic fields like name (no brackets and no quotes).

Bob

PS I strongly recommend that you **do not** use the Dynamic FromEmail field. Use Dynamic ReplyTo Email instead.
Castor 10 Nov, 2009
Hey that helped very very much and i am really pleased by your surprising constant and very fast support here in the forum. THANKS!!!

There are 2 questions left by now:
[list]
  • Is ist possible to use several input names as the "Dynamic Fromname"?
    I ask that because I use fields forename and name and i want the "Dynamic Fromname" as 'forename name' i already tried to write the two field names with space but that did not work

  • The second and more important thing is, how to put all the custom Fields into the mail.
    As you can see i have about 10 Feilds with questions to be filled in. Now i want the answers to be sent with the Email. How can i do this?
  • [/list]

    Thx already for your help 😀
    GreyHead 10 Nov, 2009
    Hi Castor,

    The Dynamic boxes only take a single field name. But you can get round this by setting the value of a new field in the OnSubmit Before box.
    <?php
    $first_name =& JRequest::getString('first_name', '', 'post');
    $last_name =& JRequest::getString('last_name', '', 'post');
    JRequest::setVar('name', $first_name." ".$last_name);
    ?>
    Then use name in the Dynamic FromName box

    ChronoForms will create an Email Template for you when you create a new Email Setup. This will include all the inputs that CF can find in your Form HTML. You can edit the template as much as you like, use {field_name} where you want the values from the form.

    Bob
    Castor 11 Nov, 2009
    That is just awesome! It's unbeliveable how flexible and intelligent the whole project is built! Thank you very much!
    This topic is locked and no more replies can be posted.