We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13331
    • 67 Posts
    Hi there,

    I’m trying to get eForm to work..

    The form does show up correctly but when i fill out the inputs and press the submit-button the form clears and it stays on the page instead of going to id =1. And most importantly I don’t receive any mail..

    The call:
    [[eForm? &formid=`minForm` &report=`mdEformRep` &tpl=`mdEform` &subject=`Kontaktform` &to=`[email protected]` &gotoid=`1`]]


    The tpl (mdEform):
    <form id="myForm" action="" method="post" name="myForm">
    	<input name="formid" type="hidden" value="minForm" />
    	<table id="mdContact" border="0" cellpadding="0" cellspacing="0">
    		<tr>
    			<td class="textcol" align="right">
    				<label for="cfName">Navn</label>
    			</td>
    			<td>
    				<input class="fieldclass" id="cfName" type="text" value="" name="navn">
    			</td>
    		</tr>
    		<tr>
    			<td class="textcol" align="right">
    				<label for="cfEmail">E-mail</label>
    			</td>
    			<td>
    				<input class="fieldclass" id="cfEmail" type="text" value="" name="email">
    			</td>
    		</tr>
    		<tr>
    			<td class="textcol" align="right">
    				<label for="cfPhone">Tlf.</label>
    			</td>
    			<td>
    				<input class="fieldclass" id="cfPhone" type="text" value="" name="telefon">
    			</td>
    		</tr>
    		<tr>
    			<td class="textcol" align="right">
    				<label for="cfWeb">Hjemmeside</label>
    			</td>
    			<td>
    				<input class="fieldclass" id="cfWeb" type="text" value="" name="web">
    			</td>
    		</tr>
    		<tr>
    			<td class="textcol" align="right" name="besked">
    				<label for="cfMessage">Besked</label>
    			</td>
    			<td>
    				<textarea class="fieldclass" id="cfMessage" cols="40" rows="5" value="" name="besked"></textarea>
    			</td>
    		</tr>
    		<tr>
    			<td></td>
    			<td><input type="submit" name="contact" id="cfContact" value="Send besked"></td>
    		</tr>
    	</table>
    </form>
    


    The report (mpEformRep):
    <p>This is a response sent by <b>[+navn+]</b> using the feedback form on this website. The details of the message follow below:</p>
     
    <p>Navn: [+navn+]</p>
    <p>Email: [+email+]</p>
    <p>Telefon: [+telefon+]</p>
    <p>Web: [+web+]</p>
    <p>Besked:<br />[+besked+]</p>
     
    <p>You can use this link to reply: <a href="mailto:[+email+]">[+email+]</a></p>
    


    Any help would be very much appreciated.
      • 33337
      • 3,975 Posts
      Use [!....!] and also remove the
      <input name="formid" type="hidden" value="minForm" />
      

      and add minForm to id field of form:
      <form id="minForm" action="[~[*id*]~]" method="post" name="minForm">
      
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 13331
        • 67 Posts
        Thank you smiley

        Any chance you could give a short explaination on how I make use of required fields?

        I need the name, email and message to be required
          • 33337
          • 3,975 Posts
          Add

          eform="Name:string:1"
          eform="Email:email:1"
          eform="Address:string:1"

          eg:
          <input class="fieldclass" id="cfName" type="text" value="" name="navn" eform="Name:string:1">
          


          For more info, have a look at assets/snippets/eform/docs/ wink
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link