Hello to all ,
This is my first tutorial , my english is not the best, so if you do not understand something say that I try to explain myself better , but try to be as concise as possible.
Today I present a simple integration between Chronoforms4 and K2 on Joomla! 3.2. I will demonstrate just 3 examples , the rest are identical !😉
I'll show you how to fill in the Title , Alias ​​and INTROTEXT .
Assume for this tutorial that the user can enter any title, the Alias ​​is like the pre-defined items of K2 (word-word-word format ... (all lowercase and separated by hyphens)) and will be hidden from the user, in other words, is automatically entered when submitting the form, and finally, the user can insert any content in INTROTEXT, and whoever follows this tutorial have the basic (reallybasic) notions in ChronoForms4!
Fist at all, you should consult your Database to confirm the name of the table fields which will be saved. Probably ithave the same name that I 'll give, but you should check it out!
In this case , the Title in the table is "title " Alias ​​'s "Alias ​​" and INTROTEXT is " introtext " .
First, we create a simple form ( Form Wizard ) :
[attachment=0]ChronoFormsK2-1.png[/attachment]
Element configuration (neatly):
Note: In this example just set the tab "General"!
[attachment=1]ChronoFormsK2-2.png[/attachment]
[attachment=2]ChronoFormsK2-3.png[/attachment]
[attachment=3]ChronoFormsK2-4.png[/attachment]
[attachment=4]ChronoFormsK2-5.png[/attachment]
And then the result should look something like:
[attachment=5]ChronoFormsK2-6.png[/attachment]
In the event, suffice two actions:
[attachment=6]ChronoFormsK2-7.png[/attachment]
And just configure the DB Save:
[attachment=7]ChronoFormsK2-8.png[/attachment]
Give a name and Save&Close!
[attachment=8]ChronoFormsK2-9.png[/attachment]
In the Forms Manager click on the form name (K2ItemForm).
In the Code tab should appear something like this:
[attachment=8]ChronoFormsK2-10.png[/attachment]
Look for this code:
And add:
So it becomes:
Save and you are done!
Note: Be careful when you change the form, because when you re-save it, the code "onclick" disappears and have to put it back.
Hopefully be useful to you;)
This is my first tutorial , my english is not the best, so if you do not understand something say that I try to explain myself better , but try to be as concise as possible.
Today I present a simple integration between Chronoforms4 and K2 on Joomla! 3.2. I will demonstrate just 3 examples , the rest are identical !😉
I'll show you how to fill in the Title , Alias ​​and INTROTEXT .
Assume for this tutorial that the user can enter any title, the Alias ​​is like the pre-defined items of K2 (word-word-word format ... (all lowercase and separated by hyphens)) and will be hidden from the user, in other words, is automatically entered when submitting the form, and finally, the user can insert any content in INTROTEXT, and whoever follows this tutorial have the basic (reallybasic) notions in ChronoForms4!
Fist at all, you should consult your Database to confirm the name of the table fields which will be saved. Probably ithave the same name that I 'll give, but you should check it out!
In this case , the Title in the table is "title " Alias ​​'s "Alias ​​" and INTROTEXT is " introtext " .
First, we create a simple form ( Form Wizard ) :
[attachment=0]ChronoFormsK2-1.png[/attachment]
Element configuration (neatly):
Note: In this example just set the tab "General"!
[attachment=1]ChronoFormsK2-2.png[/attachment]
[attachment=2]ChronoFormsK2-3.png[/attachment]
[attachment=3]ChronoFormsK2-4.png[/attachment]
[attachment=4]ChronoFormsK2-5.png[/attachment]
And then the result should look something like:
[attachment=5]ChronoFormsK2-6.png[/attachment]
In the event, suffice two actions:
[attachment=6]ChronoFormsK2-7.png[/attachment]
And just configure the DB Save:
[attachment=7]ChronoFormsK2-8.png[/attachment]
Give a name and Save&Close!
[attachment=8]ChronoFormsK2-9.png[/attachment]
In the Forms Manager click on the form name (K2ItemForm).
In the Code tab should appear something like this:
[attachment=8]ChronoFormsK2-10.png[/attachment]
Look for this code:
<input name="ButtonSubmit" id="ButtonSubmit" class="" value="Submit" type="submit" />
And add:
onclick="var str = document.getElementById(‘fieldTitle’).value; str = str.toLowerCase().replace(/[^a-z0-9\s-_æ]/gi, '').replace(/[_\s]/g, '-').replace(/-+/g, '-');document.getElementById(‘fieldAlias’).value=str;"
So it becomes:
<input name="ButtonSubmit" id="ButtonSubmit" class="" value="Submit" type="submit" onclick="var str = document.getElementById(‘fieldTitle’).value; str = str.toLowerCase().replace(/[^a-z0-9\s-_æ]/gi, '').replace(/[_\s]/g, '-').replace(/-+/g, '-');document.getElementById(‘fieldAlias’).value=str;" />
Save and you are done!
Note: Be careful when you change the form, because when you re-save it, the code "onclick" disappears and have to put it back.
Hopefully be useful to you;)