I have a client with an existing Typo3 site but I'm completely new to the CMS.
I need to add an email signup form. The site already has Mailformplus installed for the contact form.
I've added the plugin to the page. Uploaded an HTML template, and modified a copy of the Typoscript that (I think) is required in a new template.
The title for the form appears (from the plugin record) but none of the form elements. Not even an error.
What have I missed? Where should I look?
HTML:
<!-- ###TEMPLATE_FORM### begin -->
<div class="mailformplus_contactform">
###ERROR###
<form name="Formular" method="post" action="###REL_URL###" enctype="multipart/form-data">
<fieldset>
<legend>###LLL:legend###</legend>
<input type="hidden" name="id" value="###PID###" />
<input type="hidden" name="submitted" value="1" />
<input type="hidden" name="L" value="###value_L###" />
<input type="hidden" name="type" value="###value_type###" />
<label for="name">###LLL:name######required_name###</label>
<input type="text" name="name" id="name" value="###value_name###" />
<label for="company">###LLL:company###</label>
<input type="text" name="company" id="company" value="###value_company###" />
<label for="email">###LLL:email######required_name###</label>
<input type="text" name="email" id="email" value="###value_email###" />
<p>###LLL:required_fields###</p>
<input type="submit" value="###LLL:submit###" />
</fieldset>
</form>
</div>
Typoscript:
plugin.tx_thmailformplus_pi1 {
correctRedirectUrl = 1
# emailHeader =
langFile = fileadmin/template/xtra/mailformplus-locallang.xml
}
plugin.tx_thmailformplus_pi1.fieldConf {
name.errorCheck = required
company.errorCheck = required
email.errorCheck = required, email
}
### INFO #################################################
# BETREFF und Empfänger / Config extra von Mailformplus. #
# Mit Listenansicht auf die Contactseite. #
##########################################################
plugin.tx_thmailformplus_pi1.default {
email_to = simon.boak#gmail.com
email_subject = Newsletter Subscription
email_sender = simon.boak#gmail.com
email_redirect = 90
email_requiredfields =
email_htmltemplate =
email_replyto =
email_sendtouser = email
email_subject_user = TEXT
email_subject_user.value = Danke für Ihre Anfrage bei Company
email_subject_user.lang.en = Thank you for your request at Company
}
Set plugin.tx_thmailformplus_pi1.debug = 1
Your setup is really missing the template-setting
Your HTML is missing <!-- ###TEMPLATE_FORM### end --> at the end of the form.
As of point 5 in Matengs answer: Rather than reinstalling mailformplus (which is obsolete and not maintained anymore) use formhandler which is the successor of mailformplus
1.
Start checking the source code of the frontend output. Does it contain parts of your HTML template? (e.g. class="mailformplus_contactform").
2.
If not, make sure the path to the template is correct. It is set in:
plugin.tx_thmailformplus_pi2.template
If the path is correct, the source code of the template should be displayed at least.
3.
Did the extension installation finish successfully? Many extensions won't work if the necessary database tables didn't install properly. You can check in the extension manager.
4.
Furthermore, use the typoscript object browser (in module template) to verify that TYPO3 "accepted" your typoscript setup. Make sure you are on the page where you inserted the mailformplus plugin. Use the search field for that. Maybe your modified typoscript gets overridden somewhere. More hints on debugging typoscript.
5.
If that does not help, backup your current configuration and try to install mailfomrplus from the scratch - does it work when you don't use an individual configuration ?
6.
Come back here to discuss your results.
Related
Since the last update to TYPO3 6.2.47 ELTS forms (the old core forms; without use of sysext "form") are no longer rendered normally ...
<input type="text" name="name" id="mailformname" size="30" value="" />
... but the input fields seem to be sent through an HTML encoder. It now looks like this in the source code:
<input type="text" name="name" id="mailformname" size="30" value="" />
How can this be fixed?
I couldn't find anything related to this in the changelog.
There's a new parseFunc, which is responsible for the issue
tt_content.mailform.20.stdWrap.parseFunc =< lib.parseFunc
You can overwrite this as follows
tt_content.mailform.20.stdWrap.parseFunc >
I want to store my data in a database using forms.
How can I do it without using SQLFORM
like in php we use $var = $_POST['var_form']
I created a table in modul file called Produit
db.define_table('Produit',`enter code here`
Field('Nom', requires = IS_NOT_EMPTY()),
Field('Poid', 'float', requires = IS_NOT_EMPTY()),
Field('Prix', 'float', requires = IS_NOT_EMPTY()),
Field('Expiration', 'datetime'),
auth.signature)
And created a form like
{{extend 'layout.html'}}
<form action="create" method=post>
<fieldset>
<legend><h1><center><em>Ajouter un produit</em></center></h1></legend>
Nom:<br>
<input type="text" name="nom" required/>
<br>
Poid:<br>
<input type="text" name="poid" required/>
<br>
Prix:<br>
<input type="text" name="prix" required/>
<br>
Date d'expiration:<br>
<input type="date" name="exp" required/>
<br>
<br><br>
<input type="submit" value="Ajouter">
Use URL helper to specify action of the form.
<form action="{{=URL('create')}}" method=post>
...
</form>
Then in create controller, you can access submitted values using request.vars
db.Produit.insert(Nom=request.vars.nom, Poid=request.vars.poid,
Prix=request.vars.prix, Expiration=request.vars.exp)
This answer has the right idea, but to make things a little easier, you should use HTML field names that exactly match the database table field names. In that case, you can simplify the insert to:
db.Produit.insert(**db.Produit._filter_fields(request.post_vars))
Beware, though, that your manual approach lacks any protection against CSRF attacks (which the web2py form system would provide). As an alternative, note that you can still use SQLFORM even if you want to generate a custom form layout in the view. This approach is covered in the documentation here and here.
I have 2 forms on one page that I need to pass to the same page to assemble a pdf. How can I do that? I have tried using a action="post" for one and action="get" for the other, but I can't get that to work. I have tried assigning one form to session variables, but I can't get that either. Any suggestions??
<form name="formOne" id="formOne" method="post" action="#buildURL('goTothisPage.page')#">
<input name="name" id="name" autofocus="true" >
<input name="address" id="address" >
I would try just creating one big form instead of 2 smaller forms if the action is going to be the same and go to the same .cfm page. (Just expand the scope of your tags)
You can also create 2 "Submit" buttons (1 for each form) to make it appear as 2 separate forms, even though the buttons will submit the same form.
If it is required to have two separate forms in your html, it is also possible to forge the form values from one form into the other at the moment of the submit event.
HTML:
<form name="formOne" id="formOne" method="post">
<input name="name" id="name" type="text" >
<input name="address" id="addressHidden" type="hidden">
</form>
<form name="formTwo" id="formTwo" method="post">
<input name="address" id="address" type="text">
<input name="name" id="nameHidden" type="hidden" >
</form>
Javascript:
$(document).ready(function(){
$('#formOne').submit(function(event){
$('#addressHidden').val($('#address').val());
return true;
});
// same for #formTwo
$('#formTwo').submit(function(event){
$('#nameHidden').val($('#name').val());
return true;
});
});
I have this very odd issue and I've picked my code apart and taken out any caching changes that I think would cause this but it still remains.
Here is whats happening:
I add an Address in my app, named "q", I save it and get id 1 for
example.
If I add another address names "q" (q isn't restricted to unique), then save it I get id 2.
If I repeat 2 I get a new item with id 3.
Here is the weird part, if I put the mouse over the Edit button for 2 or 3 it has a link to 1. If I look at the HTML generated I get this section for the form:
<form action="/CRM/address/delete/1" method="post" ><input type="hidden" name="_method" value="DELETE" id="_method" />
<fieldset class="buttons">
Edit
<input type="submit" name="_action_delete" value="Delete" class="delete" onclick="return confirm('Are you sure?');" />
</fieldset>
</form>
If I look at the show.gsp it's just the basic code from the generated scaffold:
<g:form url="[resource:addressInstance, action:'delete']" method="DELETE">
<fieldset class="buttons">
<g:link class="edit" action="edit" resource="${addressInstance}"><g:message code="default.button.edit.label" default="Edit" /></g:link>
<g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
</fieldset>
</g:form>
The controller has the following action:
def show(Address addressInstance) {
respond addressInstance
}
When i print the addressInstance it looks like the correct one.
Does anyone have any idea why I get ID 1 instead of the proper id in this form which is on the show screen of address 2 and 3???
I've tested it in H2 and PostgreSQL, Grails 2.3.3, locally and on Heroku.
Looks like a bug linkGenerator cache in Grails 2.3.0-2.3.4.
I've created a Jira: http://jira.grails.org/browse/GRAILS-10883
You can disable the cache in your config file:
grails.web.linkGenerator.useCache = false
I have been having trouble with a bit of classic asp code
pretty much what I want to do is when a hidden field has a value of 1 a message is displayed
here is the code i have:
<% if (CStr(Request.form("HiddenLog")) = CStr("1")) then %>
<br /> <p style="color:Red;">Message here</p>
<%end if %>
<input type="hidden" id="HiddenLog" value="1" />
The result is nothing appears on screen however if I add an else to the if statment like so
<% if (CStr(Request.form("HiddenLog")) = CStr("1")) then %>
<br /> <p style="color:Red;">Message here</p>
<%else%>
<br /> <p style="color:Red;">Message here</p>
<%end if %>
The message always appears (of course this was to prove that the if statment is working and that the problem most likly is with getting the form values), can someone please tell me what it is I have done wrong
Thanks
Edit A couple of people have asked about my form so I will post that here as well
<form id="form1" method="post">
all the controls are contained inside this form
you have to give the input field a name attribute. you only have an id attribute this is not posted so just use
<input type="hidden" id="HiddenLog" name="HiddenLog" value="1" />