Forums

Need some help getting form working

Xenosis 07 Mar, 2011
Hi

I have a problem getting a form working and sending emails..

The form is made using a custom code, but I think I've done something wrong in the code, because when I tried moving around some of form code I managed to get it to send, but without radio buttons working..

I really hope someone can help me getting this form work, because am stuck and need this form online as soon as possible..

Here's a copy of the form code:

<style type="text/css">
@import url("css/form.css");
</style>

<div id="skema_top">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="20" valign="top"><h1>Tilmelding</h1></td>
        </tr>
        <tr>
          <td valign="top"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec scelerisque elementum sem sit amet fringilla. Phasellus in nibh diam, vitae mattis purus. Mauris non turpis diam, non mattis dolor. </p>
            <p>Nulla eu sem ut purus malesuada viverra. Proin euismod tellus non nunc ultrices volutpat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed rhoncus rutrum.</p></td>
        </tr>
      </table></td>
      <td width="5" valign="middle"><div align="center"><img src="images/streg.png" alt=""></div></td>
      <td width="450" valign="top"><table width="450" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="450" height="20" valign="top"><h2>Elev oplysninger</h2></td>
        </tr>
        <tr>
          <td valign="top"><table width="481">
            <tr>
              <td width="73"><div align="right"><span class="style10">Navn</span>:</div></td>
              <td width="164"><label>
                <input name="navn" type="text" class="txtf" id="navn" size="18" />
                </label></td>
              <td width="85"><div align="right" class="style1">
                <div align="right"><span class="style2">Klasse:</span></div>
                </div></td>
              <td width="139"><input name="firma" type="text" class="txtf" id="firma" size="18" /></td>
              </tr>
            </table></td>
        </tr>
        <tr>
          <td valign="top"><table width="450" border="0">
            <tr>
              <td width="187" align="right" valign="top"><div class="style10">Kommentar</div></td>
              <td width="263" valign="top"><div align="right">
                <textarea name="areaspecial" cols="52" rows="4" class="textarea" id="areaspecial"></textarea>
                </div></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
    </tr>
  </table>
</div>
<div id="skema_title">
 <h2>Spørgeskema</h2>
</div>

<div id="skema_midt">
  <table width="100%">
    <tr>
      <td width="730"><div align="left"><span class="style10">Hvilke online social netværker benytter du?(facebook, twitter osv.)</span></div></td>
      <td width="340"><label>
        <input name="social" type="text" class="txtf" id="social" size="48" />
      </label></td>
    </tr>
  </table>
</div>

<div id="skema_midt">
  <table width="100%">
    <tr>
      <td width="660"><div align="left">Vælg det tekniske niveau, som passer bedst på dig.</div></td>
      <td width="410"><form name="form2" method="post" action="">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="140" align="left"><label>
              <input type="radio" name="radio" id="skill_high" value="skill_high">
              Meget teknisk</label></td>
            <td width="140"><label>
              <input type="radio" name="radio" id="skill_mid" value="skill_mid">
              Mellem</label></td>
            <td width="140"><label>
              <input type="radio" name="radio" id="skill_low" value="skill_low">
              Lavt</label></td>
          </tr>
        </table>
      </form></td>
    </tr>
  </table>
</div>

<div id="skema_midt">
  <table width="100%">
    <tr>
      <td width="660"><div align="left">Hvor stor er din interresse for projektet?</div></td>
      <td width="410"><form name="form1" method="post" action="">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="140"><label>
              <input type="radio" name="radio" id="int_high" value="int_high">
              Meget højt</label></td>
            <td width="140"><label>
              <input type="radio" name="radio" id="int_mid" value="int_mid">
              Mellem</label></td>
            <td width="140"><label>
              <input type="radio" name="radio" id="int_low" value="int_low">
              Lavt</label></td>
          </tr>
        </table>
      </form></td>
    </tr>
  </table>
</div>

<div id="skema_midt">
  <table width="100%">
    <tr>
      <td width="660"><div align="left"><span class="style10">Nyt spørgsmål</span></div></td>
      <td width="410"> </td>
    </tr>
  </table>
</div>

<div id="skema_bund">
<input name="submit" type="submit" class="submit" id="submit" value="send" />
</div>


And here is a screenshot of the form in Joomla CMS..
http://img402.imageshack.us/i/previewhl.jpg/
GreyHead 07 Mar, 2011
Hi Xenosis,

I can see two </form> tags in the code you posted, they will almost certainly break the form. Please take them out (and any others I didn't spot) and see if the form works OK.

Bob
Xenosis 07 Mar, 2011
Ahh.. Thank you very much GreyHead, had not seen that..

It now looks like the mail sending function is working, but I still have problems getting the radio buttons and email template configured, so that I can see what people selected in the multiple choice questions..

Anyone can help me this also?
GreyHead 07 Mar, 2011
Hi Xenosis,

I can see that you have two radio button groups both with the name='radio'. This means that they will be treated as one group and only return one result. I suggest that you make the first group name='skill' and the second group name='int'

You'll need to change the Email template entries to {skill} and {int} to match these.

What else needs to change?

Bob
Xenosis 07 Mar, 2011
Hi GreyHead, thumbs up for quick support!

I've tried changing the form code, so the 2 groups have different name. But am still unable to see in the email, which radio button they selected.

I am sorry, but am totally new at form making and chronoforms🙂

Copy of the form code

<style type="text/css">
@import url("css/form.css");
</style>

<div id="skema_top">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="20" valign="top"><h1>Tilmelding</h1></td>
        </tr>
        <tr>
          <td valign="top"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec scelerisque elementum sem sit amet fringilla. Phasellus in nibh diam, vitae mattis purus. Mauris non turpis diam, non mattis dolor. </p>
            <p>Nulla eu sem ut purus malesuada viverra. Proin euismod tellus non nunc ultrices volutpat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed rhoncus rutrum.</p></td>
        </tr>
      </table></td>
      <td width="5" valign="middle"><div align="center"><img src="images/streg.png" alt=""></div></td>
      <td width="450" valign="top"><table width="450" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="450" height="20" valign="top"><h2>Elev oplysninger</h2></td>
        </tr>
        <tr>
          <td valign="top"><table width="481">
            <tr>
              <td width="73"><div align="right"><span class="style10">Navn</span>:</div></td>
              <td width="164"><label>
                <input name="navn" type="text" class="txtf" id="navn" size="18" />
                </label></td>
              <td width="85"><div align="right" class="style1">
                <div align="right"><span class="style2">Klasse:</span></div>
                </div></td>
              <td width="139"><input name="klasse" type="text" class="txtf" id="klasse" size="18" /></td>
              </tr>
            </table></td>
        </tr>
        <tr>
          <td valign="top"><table width="450" border="0">
            <tr>
              <td width="187" align="right" valign="top"><div class="style10">Kommentar</div></td>
              <td width="263" valign="top"><div align="right">
                <textarea name="areaspecial" cols="52" rows="4" class="textarea" id="areaspecial"></textarea>
                </div></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
    </tr>
  </table>
</div>
<div id="skema_title">
 <h2>Spørgeskema</h2>
</div>

<div id="skema_midt">
  <table width="100%">
    <tr>
      <td width="730"><div align="left"><span class="style10">Hvilke online social netværker benytter du?(facebook, twitter osv.)</span></div></td>
      <td width="340"><label>
        <input name="social" type="text" class="txtf" id="social" size="48" />
      </label></td>
    </tr>
  </table>
</div>

<div id="skema_midt">
  <table width="100%">
    <tr>
      <td width="660"><div align="left">Vælg det tekniske niveau, som passer bedst på dig.</div></td>
      <td width="410"><form name="form2" method="post" action="">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="140" align="left"><label>
              <input type="radio" name="skill" id="skill_high" value="skill_high">
              Meget teknisk</label></td>
            <td width="140"><label>
              <input type="radio" name="skill" id="skill_mid" value="skill_mid">
              Mellem</label></td>
            <td width="140"><label>
              <input type="radio" name="skill" id="skill_low" value="skill_low">
              Lavt</label></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</div>

<div id="skema_midt">
  <table width="100%">
    <tr>
      <td width="660"><div align="left">Hvor stor er din interresse for projektet?</div></td>
      <td width="410"><form name="form1" method="post" action="">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="140"><label>
              <input type="radio" name="int" id="int_high" value="int_high">
              Meget højt</label></td>
            <td width="140"><label>
              <input type="radio" name="int" id="int_mid" value="int_mid">
              Mellem</label></td>
            <td width="140"><label>
              <input type="radio" name="int" id="int_low" value="int_low">
              Lavt</label></td>
          </tr>
        </table>
     </td>
    </tr>
  </table>
</div>

<div id="skema_midt">
  <table width="100%">
    <tr>
      <td width="660"><div align="left"><span class="style10">Nyt spørgsmål</span></div></td>
      <td width="410"> </td>
    </tr>
  </table>
</div>

<div id="skema_bund">
<input name="submit" type="submit" class="submit" id="submit" value="send" />
</div>


And here is the generated email template:
<p><!-- @import url("css/form.css"); --></p>
<div id="skema_top">
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top">
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td height="20" valign="top">
<h1>Tilmelding</h1>
</td>
</tr>
<tr>
<td valign="top">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec scelerisque elementum sem sit amet fringilla. Phasellus in nibh diam, vitae mattis purus. Mauris non turpis diam, non mattis dolor.</p>
<p>Nulla eu sem ut purus malesuada viverra. Proin euismod tellus non nunc ultrices volutpat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed rhoncus rutrum.</p>
</td>
</tr>
</tbody>
</table>
</td>
<td width="5" valign="middle">
<div><img src="images/streg.png" border="0" /></div>
</td>
<td width="450" valign="top">
<table style="width: 450px;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="450" height="20" valign="top">
<h2>Elev oplysninger</h2>
</td>
</tr>
<tr>
<td valign="top">
<table style="width: 481px;" border="0">
<tbody>
<tr>
<td width="73">
<div><span class="style10">Navn</span>:</div>
</td>
<td width="164"><label> {navn} </label></td>
<td width="85">
<div class="style1">
<div><span class="style2">Klasse:</span></div>
</div>
</td>
<td width="139">{klasse}</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top">
<table style="width: 450px;" border="0">
<tbody>
<tr>
<td width="187" align="right" valign="top">
<div class="style10">Kommentar</div>
</td>
<td width="263" valign="top">
<div>{areaspecial}</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<div id="skema_title">
<h2>Spørgeskema</h2>
</div>
<div id="skema_midt">
<table style="width: 100%;" border="0">
<tbody>
<tr>
<td width="730">
<div><span class="style10">Hvilke online social netværker benytter du?(facebook, twitter osv.)</span></div>
</td>
<td width="340"><label> {social} </label></td>
</tr>
</tbody>
</table>
</div>
<div id="skema_midt">
<table style="width: 100%;" border="0">
<tbody>
<tr>
<td width="660">
<div>Vælg det tekniske niveau, som passer bedst på dig.</div>
</td>
<td width="410"><form method="post"> 
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="140" align="left"><label> {skill}               Meget teknisk</label></td>
<td width="140"><label> Mellem</label></td>
<td width="140"><label> Lavt</label></td>
</tr>
</tbody>
</table>
</form></td>
</tr>
</tbody>
</table>
</div>
<div id="skema_midt">
<table style="width: 100%;" border="0">
<tbody>
<tr>
<td width="660">
<div>Hvor stor er din interresse for projektet?</div>
</td>
<td width="410"><form method="post"> 
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="140"><label> {int}               Meget højt</label></td>
<td width="140"><label> Mellem</label></td>
<td width="140"><label> Lavt</label></td>
</tr>
</tbody>
</table>
</form></td>
</tr>
</tbody>
</table>
</div>
<div id="skema_midt">
<table style="width: 100%;" border="0">
<tbody>
<tr>
<td width="660">
<div><span class="style10">Nyt spørgsmål</span></div>
</td>
<td width="410"></td>
</tr>
</tbody>
</table>
</div>
<div id="skema_bund"></div>
GreyHead 07 Mar, 2011
Hi Xenosis,

You appear to have <form> tags inside your Email template code which is unusual.

Please turn debug on in the form General Tab, then submit the form and post the debug - including the 'dummy emails' results here.

Bob
Xenosis 07 Mar, 2011
I've removed the form tags from the email template now also.

Here is the debug result:

Form passed first SPAM check OK
Form passed the submissions limit (if enabled) OK
Form passed the Image verification (if enabled) OK
Form passed the server side validation (if enabled) OK
$_POST Array: Array ( [navn] => Martin Jensen [klasse] => 9B [areaspecial] => test [social] => Facebook [skill] => skill_mid [int] => int_mid [submit] => send [238411c4e4346f10fc6ccdd6e107f80f] => 1 [1cf1] => 1e648de4b61c57e2492d6944077210f4 [chronoformname] => skema )
$_FILES Array: Array ( )
Form passed the plugins step (if enabled) OK
An email has been SENT successfully from (Spørgeskema)Martin@mydomain.dk to [email]Martin@mydomain.dk[/email]
Debug End



This is the email i receive:

Tilmelding

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec scelerisque elementum sem sit amet fringilla. Phasellus in nibh diam, vitae mattis purus. Mauris non turpis diam, non mattis dolor.
Nulla eu sem ut purus malesuada viverra. Proin euismod tellus non nunc ultrices volutpat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed rhoncus rutrum.

Elev oplysninger

Navn:
Martin
Klasse:
9B
Kommentar
test

Spørgeskema
Hvilke online social netværker benytter du?(facebook, twitter osv.)
Facebook

Vælg det tekniske niveau, som passer bedst på dig.
skill_high Meget teknisk
Mellem
Lavt


Hvor stor er din interresse for projektet?
int_high Meget højt
Mellem
Lavt


Nyt spørgsmål



Here's the new email template:
<p><!-- @import url("css/form.css"); --></p>
<div id="skema_top">
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top">
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td height="20" valign="top">
<h1>Tilmelding</h1>
</td>
</tr>
<tr>
<td valign="top">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec scelerisque elementum sem sit amet fringilla. Phasellus in nibh diam, vitae mattis purus. Mauris non turpis diam, non mattis dolor.</p>
<p>Nulla eu sem ut purus malesuada viverra. Proin euismod tellus non nunc ultrices volutpat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed rhoncus rutrum.</p>
</td>
</tr>
</tbody>
</table>
</td>
<td width="5" valign="middle">
<div><img src="images/streg.png" border="0" /></div>
</td>
<td width="450" valign="top">
<table style="width: 450px;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="450" height="20" valign="top">
<h2>Elev oplysninger</h2>
</td>
</tr>
<tr>
<td valign="top">
<table style="width: 481px;" border="0">
<tbody>
<tr>
<td width="73">
<div><span class="style10">Navn</span>:</div>
</td>
<td width="164"><label> {navn} </label></td>
<td width="85">
<div class="style1">
<div><span class="style2">Klasse:</span></div>
</div>
</td>
<td width="139">{klasse}</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top">
<table style="width: 450px;" border="0">
<tbody>
<tr>
<td width="187" align="right" valign="top">
<div class="style10">Kommentar</div>
</td>
<td width="263" valign="top">
<div>{areaspecial}</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<div id="skema_title">
<h2>Spørgeskema</h2>
</div>
<div id="skema_midt">
<table style="width: 100%;" border="0">
<tbody>
<tr>
<td width="730">
<div><span class="style10">Hvilke online social netværker benytter du?(facebook, twitter osv.)</span></div>
</td>
<td width="340"><label> {social} </label></td>
</tr>
</tbody>
</table>
</div>
<div id="skema_midt">
<table style="width: 100%;" border="0">
<tbody>
<tr>
<td width="660">
<div>Vælg det tekniske niveau, som passer bedst på dig.</div>
</td>
<td width="410">
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="140" align="left"><label> {skill}               Meget teknisk</label></td>
<td width="140"><label> Mellem</label></td>
<td width="140"><label> Lavt</label></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<div id="skema_midt">
<table style="width: 100%;" border="0">
<tbody>
<tr>
<td width="660">
<div>Hvor stor er din interresse for projektet?</div>
</td>
<td width="410">
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="140"><label> {int}               Meget højt</label></td>
<td width="140"><label> Mellem</label></td>
<td width="140"><label> Lavt</label></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<div id="skema_midt">
<table style="width: 100%;" border="0">
<tbody>
<tr>
<td width="660">
<div><span class="style10">Nyt spørgsmål</span></div>
</td>
<td width="410"></td>
</tr>
</tbody>
</table>
</div>
GreyHead 07 Mar, 2011
Hi Xenosis,

I've highlighted the form results in blue in the Debug report and the email.

It looks to me as though they match up OK -- though as this isn't the dummy email from the debug page the data entries don't match exactly. (I guess that they cam from different test submissions.)

Bob
This topic is locked and no more replies can be posted.