Autofill fields in Facile Forms

16 years 8 months ago #44268 by deanc
Autofill fields in Facile Forms was created by deanc
Hi

I wanted to know if there was anyway that the information collected on the users profile during registration could be automatically filled into a form (using Facile Forms Component).

I other words, if the user goes into a form, there is no need to refill all their details as it would be done automatically?

Thanks

Dean

Please Log in to join the conversation.

16 years 3 months ago #55879 by themandril
Replied by themandril on topic Re:Autofill fields in Facile Forms
I would like to know too - whether with Facile, Phil-a-form or whatever - can we have them autofill with the logged in user's CB data?

Please Log in to join the conversation.

16 years 3 months ago #55889 by nant
Replied by nant on topic Re:Autofill fields in Facile Forms
themandril wrote:

I would like to know too - whether with Facile, Phil-a-form or whatever - can we have them autofill with the logged in user's CB data?


don't know the answer.

I would ask Phil - the developer.

Please Log in to join the conversation.

15 years 11 months ago #63346 by hifi
Replied by hifi on topic Re:Autofill fields in Facile Forms
That would be awesome! You found a solution?

Please Log in to join the conversation.

15 years 8 months ago #74535 by ripplestone
Replied by ripplestone on topic Re:Autofill fields in Facile Forms
I have written some PHP code that can be added to phil-a-form to make auto population work. It connects directly to the mySQL database, and pulls the variable information for the current user who is logged in.

It requires you to use specific FIELD names when creating a form in phil-a-form. The field names you must use are:
First, Last, Email, Company, Title, Address1, Address2, City, Zip, Phone

You will need to edit it to make it fit your custom situation. But this is the information I use:

Database Name: cmcros_cmcrossroadsjoomla
Community Builder Table Name: jos_comprofiler

Joomla! 1.0.13 Stable
Apache, PHP 4.4.7
MySQL 4.1.19
Community Builder: 1.1
Phil-A-Form v1.6.7


Edit the file located:
./components/com_philaform/elements/textbox.php

replace the following code (line 60):

[code:1]
$cleaner = $noHtmlFilter->process($this->value);
$value .= "\" $maxlength value=\"".$cleaner."\"";
[/code:1]

With this code attached with this post.



It works for us at www.CMCrossroads.com
Let me know if you know of a cleaner or more efficient way to do this.

Attachment autopopulate.txt not found



Post edited by: ripplestone, at: 2008/09/17 01:03

Post edited by: ripplestone, at: 2008/09/23 18:22
Attachments:

Please Log in to join the conversation.

15 years 7 months ago #75293 by ripplestone
Replied by ripplestone on topic Re:Autofill fields in Facile Forms
I have updated the code to fix a bug. Use the code attached to this post, and not the last post.


Does anyone know how to get variables from Community Builder without useing a call to mySQL? What is other code that can be used instead of:

[code:1]
<?php
mysql_select_db($dbname)or die ('Error connecting to database__');
$query = "SELECT * FROM jos_comprofiler WHERE user_id='". $user_id ."'";

if($currentKey == "Company"«»){
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
$cleaner=mysql_result($result,"0","cb_company"«»);
}
?>
[/code:1]

Attachment autopopulate_code.txt not found

Attachments:

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.283 seconds

Facebook Twitter LinkedIn