The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Using Hooks Manager to create prefilled Comment/Instruction fields - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Using Hooks Manager to create prefilled Comment/Instruction fields (/showthread.php?tid=15082) |
Using Hooks Manager to create prefilled Comment/Instruction fields - ADaniel - Sep 3rd, 2016 How to add blocks of description or instructions to a FormTools form by using Hooks Manager to prefill a “Comment/Instruction” field First create a field in your form to hold this description or comment, and make sure to set the field type and size so that it will hold and display the description text. I use Field Type “Text Area” when I need a large block of description; otherwise I use a text box. For Text Area, I might use these settings: Field Size Large Text Date Type String DB Column Whatever name you want as the actual database field name In order to prevent the displaying of the actual Field Name (In my case I only am interested in showing the pre-filled content of the field to the form user, not the Form Field Display name), I change the Field settings to have a Display Text setting of <font color="white">Descrip1|</font> (replacing Descrip1 with your Display Text for this field), which in my form’s case makes the Display Text invisible to the form user against the background color, and causes the Comment/Instructions to appear to be a standalone text block. Create as many fields as you need to hold the comment/instructions on your form. Edit your View and make sure the comment/instruction fields are placed where you want them to appear, and uncheck “Editable” After installing the Hooks Manager, open the module and create a new Rule, name it something such as “Prefill YourFormName with User Instructions” I use a priority of 51 Hook Type Code Hook Select Hook Type of ft_create_blank_submission, end Sample PHP Code – In the sample code below, replace the field name “Descrip1” with the actual field name you are using to display this Instruction/Comment. Set the value of $descrip = whatever text you want to appear on the form, and replace the form number in $form_id == 4 with whatever your actual form number is. Inside the If statement, you can repeat the block for $descrip= and the block for mysql_query(… for each field you are prefilling. Or, you can write a more elegant bit of PHP to prefill more than one field with this same Hook. Here is the sample PHP Code: Global $g_table_prefix; //This code creates longer field descriptions and comments by adding field default information to certain fields that are used as descriptions for other fields, for the Form ######. If ($form_id == 4){ //only do code if this is Form #_ $descrip = ‘Whatever information you want to tell your form user goes here. It can be quite long, depending on what you have specified in your Field Settings back in the Form Itself. '; mysql_query("UPDATE {$g_table_prefix}form_{$form_id} SET Descrip1 = '$descrip' WHERE submission_id = $new_submission_id"); } RE: Using Hooks Manager to create prefilled Comment/Instruction fields - mquisuisje - Nov 29th, 2016 Hello @ADaniel, I am new on the use of Formtools. I'm on a technical platform. I would like to create a form so that before each use of the devices, the user fills out the form. I think Formtools is quite fit. I did not have to worry about creating my fields because the software is intuitive. But I do not see how to add a field where I am the only one to put text for the instructions and a table for the costs of use. I think that with the Hooks Manager module it is possible but I do not see how to do it. I hope you can help me make this field because you seem to master this module and PHP code. Thank you. RE: Using Hooks Manager to create prefilled Comment/Instruction fields - ADaniel - Nov 29th, 2016 Yes, it is certainly possible to create a field or multiple fields on your form that contain instruction text and have that text appear when the form is first displayed to the user. If you follow my instructions in the original post in this thread you can do that. Are you having trouble with a specific part of those instructions ? Annette RE: Using Hooks Manager to create prefilled Comment/Instruction fields - jiuer7845 - Aug 26th, 2021 Nike Air Jordan Jordan Shoes Jordans Shoes Yeezy 350 V2 Adidas Yeezy Yeezy Yeezy 700 Yeezy Nike Outlet Yeezy Shoes UNC Jordan 1 Jordan 13 Jordan AJ 1 Yeezy Foam Runner Nike Outlet Nike Outlet AJ1 Yeezy Supply Yeezy Zebra Jordan 1 Low Air Jordans Pandora Charms Adidas UK Nike Store Adidas Yeezy Official Website Yeezy 350 Jordan 1 Nike Outlet YEEZY SUPPLY Pandora Charms Nike Shoes Nike Outlet Pandora Outlet Jordan Shoes Air Jordan 4 Pandora Jewelry Pandora Rings Pandora Bracelets Adidas Yeezy Yeezy Pandora Charms Nike Outlet Adidas Yeezy Air Max 720 Nike Air Max 270 Air Jordan 11 Air Force 1 Air Jordan 1 Nike Jordans Jordan 1s Pandora UK Nike Jordan 1 Jordan 1 Yeezy Slides Nike Air VaporMax Nike Vapormax Flyknit Air Jordan 1 Mid Adidas yeezy Yeezy Shoes Adidas Yeezy Yeezy 350 Nike Shoes Nike Outlet Yeezy NFL Shop Official Online Store Nike UK Yeezy Yeezy 350 |