Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
Elxis 5.5 Calypso supports 2 factor authentication login with e-mail or SMS.
Home
Help
Login
Register
Elxis CMS Forum
»
Support
»
General
(Moderators:
Ivan Trebješanin
,
Farhad Sakhaei
) »
How to create form using Any Form
« previous
next »
Print
Pages: [
1
]
Author
Topic: How to create form using Any Form (Read 7181 times)
komang
Newbie
Posts: 34
How to create form using Any Form
«
on:
February 11, 2018, 03:53:15 »
Hi all,
I tried to create a form using "Any Form Plugin". I tried to use the sample form but no form was generated.
Can anyone help me or give me an example of a simple form? I have a very basic PHP and mySQL coding knowledge.
(see the attachment bellow)
Thank you
Logged
ksmtour.com
datahell
Elxis Team
Hero Member
Posts: 10356
Re: How to create form using Any Form
«
Reply #1 on:
February 11, 2018, 19:06:56 »
Is the AnyForm plugin published?
Extensions > Content plugins > Publish "AnyForm" plugin
«
Last Edit: February 11, 2018, 19:10:49 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
komang
Newbie
Posts: 34
Re: How to create form using Any Form
«
Reply #2 on:
February 12, 2018, 02:55:56 »
Hi Datahell,
Yes, the Any Form plugin is already published (the screenshot is attached below).
Thanks for your response
Logged
ksmtour.com
datahell
Elxis Team
Hero Member
Posts: 10356
Re: How to create form using Any Form
«
Reply #3 on:
February 12, 2018, 23:06:53 »
Strange. If AnyForm is published, the xml form exists, it is integrated correctly into an article it should be displayed. I cant help you without seeing it. If you wish send me a personal message with username/password for your site's administration to check it. Also write me the article you integrated the form.
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
komang
Newbie
Posts: 34
Re: How to create form using Any Form
«
Reply #4 on:
February 13, 2018, 09:06:53 »
Hi Datahell,
It was my fault. The plugin doesn't work maybe because I put it in a category's description. when I integrated it to an article, the form woks (it send email succesfully).
I have two more question:
1. I read on it help : beside email action it support database,
database: Save submitted form data to a database table (set dbtable parameter in XML file and use #__ as Elxis database prefix).
How can I set the database in XML file? can anyone give me a simple example? assume I want to save the data on the sample to database.
2. Beside send the data via email or save it to database, I want to display it after the user submit the form. I think it should be easy but when I tried it using javascript, it didn't work.
Thank you Datahell and all...
Logged
ksmtour.com
datahell
Elxis Team
Hero Member
Posts: 10356
Re: How to create form using Any Form
«
Reply #5 on:
February 13, 2018, 15:01:03 »
1. You must create the database table. Go to phpmyadmin and create the database table based on the form elements. For each form element create a column in your db table to store the submitted data. Be careful to keep the same order in your xml file. Also add first a column with a primary key.
Example
Asume your form has 3 elements: Firstname, Lastname and Email. Create this db table:
CREATE TABLE elx_anyform_data (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`firstname` VARCHAR(60) DEFAULT NULL,
`lastname` VARCHAR(60) DEFAULT NULL,
`email` VARCHAR(60) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Afterwords in anyform XML file set
dbtable = "#__anyform_data"
2. AnyForm does not support this.
«
Last Edit: February 13, 2018, 15:04:07 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
komang
Newbie
Posts: 34
Re: How to create form using Any Form
«
Reply #6 on:
February 20, 2018, 07:29:54 »
Hi Datahell,
I tried this but it can't save data to database. I created the database table (see the attachment) then I set dbtable = "#__anyform_data" on the sampel.xml but I am not sure the way I set the dbtable is right. I learned XML at
https://www.xml.com/pub/a/2001/02/07/trxml9.html
.
please check the sampel.xml below.
The form can be access at
https://finteku.com/diskusi/apakah-perkembangan-fintek-bisa-mengancam.html
Sorry, I don't understand about XML.
Thank you
Regards,
Komang
<form>
<title overwrite="1" hide="1">Sample form</title>
<emailtitle>Submitted sample form</emailtitle>
<description><![CDATA[
<p><strong>AnyForm</strong> is a plugin that allows you to display and process custom HTML forms within Elxis 4.x content items.
This sample form contains all types of elements AnyForm supports in order to use it as a sample for your own forms.
Created by Ioannis Sannos © 2008-2017 <a href="
https://www.isopensource.com
" title="IOS - Web services and software">Is Open Source</a>.
All rights reserved.</p>
]]>
</description>
<onsuccess><![CDATA[
<h3>Success!</h3>
<p class="anyf_success">This is a sample text that is being displayed after successfully submitting the form. Plugin <strong>AnyForm</strong> by isopensource.com
allows you to easily change this message by editing the form info on XML file.</p> ]]>
</onsuccess>
<action>email</action>
<email></email>
<dbtable dbtable = "#__anyform_data"></dbtable>
<items>
<item type="openfieldset" label="PERSONAL_INFORMATION" />
<item type="text" name="name" label="FIRSTNAME" required="1" default="{FIRSTNAME}" tip=""></item>
<item type="text" name="surname" label="LASTNAME" required="1" default="{LASTNAME}" tip=""></item>
<item type="text" name="phone" label="TELEPHONE" required="1" default="" tip=""></item>
<item type="email" name="email" label="EMAIL" required="1" default="{EMAIL}" tip=""></item>
<item type="radio" name="gender" label="Gender" default="0" tip="">
<option value="0">Male</option>
<option value="1">Female</option>
</item>
<item type="range" name="age" label="AGE" first="0" last="120" step="1" default="30" tip=""></item>
<item type="closefieldset" />
<item type="openfieldset" label="Travel information" />
<item type="date" name="date" label="DATE" required="1" default="{TOMORROW}" tip="" />
<item type="closefieldset" />
<item type="openfieldset" />
<item type="norobot" name="notrobot" label="" default="" tip="" />
<item type="button" name="sbt" label="" default="SUBMIT" button_type="submit" fieldboxclass="" />
<item type="closefieldset" />
</items>
</form>
Logged
ksmtour.com
webgift
Elxis Team
Hero Member
Posts: 4193
Re: How to create form using Any Form
«
Reply #7 on:
February 20, 2018, 09:41:20 »
'action' field should be changed for sure. Use 'database' or
'emaildatabase' instead of 'email'.
I think that dbtable should be set like:
<dbtable>#__anyform_data</dbtable>
Logged
Elxis Team •
Custom web design [EN]
-
[EL]
•
.GR Registrar
komang
Newbie
Posts: 34
Re: How to create form using Any Form
«
Reply #8 on:
February 20, 2018, 10:07:18 »
Hi webgift,
yess, it works...
I tried <dbtable>#__anyform_data</dbtable> but I forget to change the action field.
Thank you so much
Logged
ksmtour.com
webgift
Elxis Team
Hero Member
Posts: 4193
Re: How to create form using Any Form
«
Reply #9 on:
February 20, 2018, 15:48:04 »
You're welcome @komang!
Logged
Elxis Team •
Custom web design [EN]
-
[EL]
•
.GR Registrar
Print
Pages: [
1
]
« previous
next »
Elxis CMS Forum
»
Support
»
General
(Moderators:
Ivan Trebješanin
,
Farhad Sakhaei
) »
How to create form using Any Form