Example
If you have activated validation JS in constants (default), than you can validate values of textfields just after input in frontend:
Example: Mandatory check
Example: E-Mail check
Check for:
This validation of textfields are currently possible:
Mandatory
URL
Numbers
Numbers (with comma or point)
Letters
Letters and numbers
Error Message:
Note: Current error messages are in german and english – you can change or add your own messages via locallang or typoscript (see above)
Stylesheet classes to manipulate validation messages and input fields:
If error in inputfields: <input class=“validation-failed” />
If no error in inputfields: <input class=“validation-passed” />
DIV Layer of errormessage: <div class=”powermail_mandatory_js”>error</div>
Email of sender
Email of user will be automaticly checked, as soon as the email field is selected in backend
Autocheck via typoscript
Use typoscript to check any field like (example to check uid41 if it is an email):
plugin.tx_powermail_pi1 {validate.uid41.auto = email
validate.uid41.errormsg = Please check your email, there is an error!
}
This autochecks are possible:
email: check if value is an email
url: check if value is a correct url
numbers: only numbers allowed
phone: numbers and / and + and - allowed
alphanum: only numbers and characters allowed
Manual check via typoscript (using regulare expressions)
Use typoscript (in the setup) to check any field like (example to check uid41 if it is an url):
plugin.tx_powermail_pi1 {validate.uid41.expression = ^(http://)?([a-z0-9-]+\.)+([a-z0-9-]{2,3})$^validate.uid41.errormsg = Sorry, but this is not a correct URL, try again!
}
You can enter any regulare expression go check your field values
Further regex examples:
plugin.tx_powermail_pi1 {validate.uid23.expression = /^alex\@wunschtacho\.de$/
validate.uid23.errormsg = Sorry, but this field should contain alex@wunschtacho.de!
}
plugin.tx_powermail_pi1 {validate.uid25.expression = /^###UID26###$/
validate.uid25.errormsg = Sorry, but your password fields are different – try again!
}
plugin.tx_powermail_pi1 {
dbEntry.tt_address.uid41 = email
dbEntry.tt_address.uid65 = first_name
dbEntryDefault.tt_address.pid = [pid]
dbEntryDefault.tt_address.name = Alex Kellner
dbEntryDefault.tt_address.www = www.test.de
dbEntry.fe_users.uid41 = email
dbEntry.fe_users.uid65 = username,name
dbEntryDefault.fe_users.crdate = [tstamp]
dbEntryDefault.fe_users.tstamp = [tstamp]
}
Save content of uid41 in field “email” in table “tt_address”
Save content of uid65 in field “first_name” in table “tt_address”
Saves the current pid to the field “pid” in tt_address (e.g. 13)
Always save “Alex Kellner” in field “name” in tt_address
Always save “www .test.de” in field “www” in tt_address
Save content of uid41 in field “email” in table “fe_users”
Save content of uid65 in field “username” and in field “name” in table “fe_users”
Save timestamp to field “crdate” in table “fe_users”
Save timestamp to field “tstamp” in table “fe_users”
Saving is available only if table and field are existing
Every table contains one record
dbEntryDefault is only available with dbEntry
You can save your values to more fields, when you separate your fields with comma (,)
With this small add to powermail, you can use powermail for many features like guestbook form, tipafriend form, fe_user registration, tt_address registration and so on...
We suggest you to use the extension wt_spamshield for fighting spam entries (see details in manual wt_spamshield)
You can also use captcha (see next paragraph)
First of all install a captcha extension like captcha or sr_freecap
Be sure, that you have chosen this extension via constants (captcha or sr_freecap)
As you can add a normal textfield, you can add a captcha field, thats all
If you have installed captcha AND sr_freecap, the extension use sr_freecap
If you have not installed one of this extensions, an error message in frontend is shown
Example: Using captcha
Example: Using sr_freecap