Pre-User: Can FlexiContent add data to a form submission?

More
12 years 4 months ago #41517 by strgg
You can already do this without creating a new custom field.

1. create a text field for the 8digit-number.
2. set its style attribute to hidden in
the template override from

form.php

or add a class within flexicontent.

3. set its value via php in

form.php

Code:
value="<?php echo microtime();//use custom ?>"

4. include the value into the email sent to user

EDIT:
Sorry, Point3 seems not to work in flexicontent. Its here far more complicated and not accessible as other cck's from Joomla. You have to do it via Javascript for ex.
Code:
<script> document.getElementById("custom_field77_0").value = new Date().getTime();</script>
But this is dangerous because it could be altered by user. Serverside is needed even here to check uniqueness (and vulnerability if out-of-framework saving).

AT ggppdk: How can we access/differ the form value in form.php to be preset onload?
i see it to be called only prestructured like
Code:
echo $field->html;

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago #41520 by ggppdk
Hello

exactly you must not rely on form posted value for critical data,

so you need to create the field value after the form is submitted

via FLEXIcontent field function:
onBeforeSaveField()

e.g. all important security data are checked after form is submitted in case the form was tampered,

categories access, create / edit privilege, etc, etc, also if you use the submit menu override, these are also checked after the form is submitted in case the user has tampered the form

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago #41521 by ggppdk
Hello

if you duplicate the weblink field

then it will be easy to replace "weblink" with "myfieldtype"

(just take care to do case-sensitive replacements)

then zip it and install it via Joomla extensions Manager, and then publish it


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save