Elxis CMS Forum

Extensions => Bots and plugins => Topic started by: datahell on March 30, 2017, 23:59:09

Title: AnyForm plugin
Post by: datahell on March 30, 2017, 23:59:09
I just released a free form generation plugin for Elxis. With AnyForm you can create really ANY standard form as it uses Elxis Form library in the backend. i am sure many people will love it.

You can download AnyForm plugin (https://www.elxis.net/edc/miscellaneous/142.html) from EDC.

More information tomorrow.
Title: Re: AnyForm plugin
Post by: nikos on March 31, 2017, 09:16:02
Great news, great plugin! Congratulations !!!
Title: Re: AnyForm plugin
Post by: webgift on March 31, 2017, 12:17:48
Really great and complete extension!
Title: Re: AnyForm plugin
Post by: chongbing on March 31, 2017, 18:06:51
Awesome!
Title: AnyForm plugin v1.2
Post by: datahell on April 02, 2017, 09:59:34
Plugin AnyForm updated to version 1.2

I would like to make a general presentation of the plugin as I haven't done so yet. If you have any questions you can reply below.

Most important features

Download AnyForm for free from EDC (https://www.elxis.net/edc/miscellaneous/142.html).

Examples
A few example of how you declare form items in XML files.

A text input field:
<item type="text" name="name" label="FIRSTNAME" default="{FIRSTNAME}" tip="Please write your name"></item>

A date picker:
<item type="date" name="date" label="DATE" required="1" default="{TOMORROW}" tip="" />

An "I am not a robot" captcha field:
<item type="norobot" name="notrobot" label="" default="" tip="" />


License

Plugin AnyForm is free. Forms generated by AnyForm display a small copyright note at the bottom. This is the only reward for Ioannis Sannos, the developer of AnyForm, for giving you this plugin for free. If you don't want to display this copyright you can purchase a license to remove it (https://www.isopensource.com/shop/software/11.html). By purchasing a copyright removal license you also get extended documentation for AnyForm plugin written by Ioannis Sannos.

Copyright removal and documentation by Is Open Source (https://www.isopensource.com/shop/software/11.html)
Title: Re: AnyForm plugin
Post by: seadhna on April 27, 2022, 19:42:02
Hi datahell,
with ANYFORM, is it possible to add an upload button to allow user to attach a file to their submission?
Title: Re: AnyForm plugin
Post by: datahell on April 27, 2022, 21:55:47
It is possible but now it is not supported, mostly for security reasons.
Title: Re: AnyForm plugin
Post by: seadhna on April 28, 2022, 11:33:37
Do you have any advice on how I could allow users to upload a document with their form?
I tried using Professional Form Manager but it's not compatible with the latest version of Elxis.
If AnyForm is not an option either, are there any other options?
Thanks for any advice you can give!
Title: AnyForm 2.1 with image and file upload support
Post by: datahell on May 09, 2022, 22:00:04
AnyForm updated to version 2.1. From this version AnyForm supports generating Image and File upload fields. After clicking submit the files/images get uploaded in folder media/anyform/ and also a download link is sent to the form's recipient email. This link is protected, if the site guest also gets the email there is no download link for him. Except from file uploads version 2.1 sends beautiful HTML e-mails.

Download/Update AnyForm 2.1 for free from EDC (https://www.elxis.net/edc/miscellaneous/142.html)
Title: Re: AnyForm plugin
Post by: nikos on May 13, 2022, 13:32:41
Great update! Congratulations once again !!!
Title: Re: AnyForm plugin
Post by: Dimitris Kanatas on May 13, 2022, 21:42:14
Μπράβο Γιάννη! Πολύ καλή δουλειά!
Title: Re: AnyForm plugin
Post by: datahell on May 14, 2022, 12:32:50
Thank you guys. If I find some time I will improve it even more.
Title: Re: AnyForm plugin
Post by: seadhna on June 17, 2022, 16:50:36
This is a great plugin with a great improvement in the new version. If we choose to store submissions to the database, how do we access/view the submissions afterwards? Is it possible via Elxis or only via directly accessing the SQL database.
Title: Re: AnyForm plugin
Post by: datahell on June 17, 2022, 21:22:45
Both options are possible. However the Elxis option requires to develop a special module or component in order to read the database entries, and maybe even edit/delete them. For now there is no such extension available. So, the working solution you have right now is PHPMyAdmin.
Title: Re: AnyForm plugin
Post by: seadhna on June 22, 2022, 14:28:01
Ok, thanks!
Is there any way to make any of these form items visible in the automatic email: 3.37 note, 3.38 info, 3.39 custom, 3.40 html
What I would love to do is add some custom HTML that appears in the email.
Title: Re: AnyForm plugin
Post by: datahell on June 22, 2022, 18:33:13
These type of elements do not contain user data. Their role is to provide visual aid to the person that fills-in the form. So, they are not been displayed in the e-mail, neither get saved in an other way (file/database). However what you ask can be done but needs plugin modification.
Title: Re: AnyForm plugin
Post by: seadhna on June 22, 2022, 20:23:56
Ah ok. I thought of a different solution: Display the custom HTML as the "onsuccess" message in the page. This is working fine except... users need to scroll down to the form location on the page to see the message. Is there a way to scroll the user automatically to the success message when the page refreshes? I tried a few javascript solutions but they don't work unfortunately.
Title: Re: AnyForm plugin
Post by: datahell on June 22, 2022, 20:49:34
Yes, it can be done. Follow my instructions.

Open your form's XML and find the "onsuccess" part. There I guess you have some HTML content inside some tags. Add an ID attribute to any of these tags (preferable the first one) to "anyfsucmsg".

Example:
<onsuccess><![CDATA[
   <h3 id="anyfsucmsg">Success!</h3>
    <p class="anyf_success">This is a sample text...</p>]]>
</onsuccess>
Save the XML.

Now, go and open your template's index.php file and put the code below anywhere (prefer the top section before the starting the "html").

$js = 'if (document.getElementById(\'anyfsucmsg\')) { document.getElementById(\'anyfsucmsg\').scrollIntoView(); }';
eFactory::getDocument()->addNativeDocReady($js);

That's it.

Explanation: The code above after the page gets completely loaded it searches for an element with id "anyfsucmsg". If it find it it scrolls down the user to that element.

I didn't tested it, test it. I guess it will work fine. Off course you can rename "anyfsucmsg" to anything you want.
Title: Re: AnyForm plugin
Post by: seadhna on June 23, 2022, 14:11:27
Beautiful solution! This works on a test installation using the FIVE template. It doesn't work on a production site - do you know if there are any dependencies, e.g. a particular version of Jquery?
If I figure out through troubleshooting, I'll post here. Thanks for this.
Title: Re: AnyForm plugin
Post by: datahell on June 23, 2022, 21:09:08
The code I wrote you doesn't use jQuery but native javascript (Elxis 5.x method "addNativeDocReady"). Requires Elxis 5.x, don't try it on Elxis 4.x. So except from Elxis version has no other dependency.

It should work on any template, and even on any other type of extension. If it doesn't work then make sure you have put the code correctly, and if it doesn't work again check if it conflicts with an other page scroll on the same page. A lin to the page is required for further assistance.
Title: Re: AnyForm plugin
Post by: seadhna on June 24, 2022, 19:35:58
Ok, thanks!
I just noticed a slight discrepancy between the Anyform manual and the sample form, regarding the "I am not a Robot" verification:

Manual: <item type="norobot" name="norobot" label="" default="" tip=""></item>   
Sample Form: <item type="norobot" name="notrobot" label="" default="" tip="" />

Manual: name is norobot, there is a closing tag
Sample: name is notrobot and the tag is self-closing.

I don't know if this is important.
Title: Re: AnyForm plugin
Post by: datahell on June 24, 2022, 20:20:36
They are the same. It is an other way of writing the same thing.
<tag></tag> is equivalent to <tag />
Title: Re: AnyForm plugin
Post by: nikos on August 07, 2022, 13:02:50
Good morning

Working with Anyform version 2.1 on a localhost Elxis 5.3 rev2452 installation and setting in sample.xml file form as action "database" following the example of the documentantion, everything works fine and the submitted form data are saved into table elx_sample. But when I put into form an <item type="openfieldset" /> and at the end i close it with <item type="closefieldset" /> like below

Code: [Select]

<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="range" name="age" label="AGE" first="0" last="120" step="1" default="30" tip=""></item>
        <item type="closefieldset" />
<item type="norobot" name="notrobot" label="" default="" tip="" />
<item type="button" name="sbt" label="" default="SUBMIT" button_type="submit" fieldboxclass="" />
</items>


then submitting the form I get the following error:

ERROR in file C:\apachefriends\htdocs\elxis53\includes\libraries\elxis\database\statement.class.php line 41
Uncaught PDOException: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1 in C:\apachefriends\htdocs\elxis53\includes\libraries\elxis\database\statement.class.php:41

Please have it in mind for a next update.
Title: Re: AnyForm plugin
Post by: datahell on August 08, 2022, 11:28:59
There is nothing wrong in AnyForm. Your database table should match XML items except from the items types listed below:
openfieldset, opentab, closetab, openrow, closerow, button, html, custom, note, info, opentoolbar, closetoolbar, starttabs, endtabs, norobot

There is one exception: The database table should contain a column for item type "closefieldset" if such an item exists in XML.
So your table should have these columns: id, firstname, lastname, age, cf (you can name your columns whatever you want)
Title: Re: AnyForm plugin
Post by: nikos on August 08, 2022, 12:54:51
Thank you for the additional information on subject. I did it as you suggest and it works fine.