Go Back   Mosets Community > Archives > Mosets Tree 2.2 > Discussions, Troubleshooting & Problems

 
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-26-2011, 08:16 AM
abdelkadermalki abdelkadermalki is offline
Mosets'd
 
Join Date: Oct 2010
Posts: 5
Exclamation Customize field in 'Add listing' - Autocompletion

Hello,

I want to integrate files to call them when I write something in a field of type "text".

Field type "text" like that:
PHP Code:
class mFieldType_enhancedText extends mFieldType {

function 
getInputHTML() {
require_once (
JPATH_SITE.'/components/com_mtree/templates/m2/autocomplete/config.php');
$html '';
$html .= '<input type="text" name="course" id="course" />';
return 
$html;

File "autocomplete.php" to integrate or call:
PHP Code:
<?php
session_start
();
ob_start();
require_once (
JPATH_SITE.'/components/com_mtree/templates/m2/autocomplete/config.php');
?>
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->jconf['live_site']; ?>/components/com_mtree/templates/m2/autocomplete/jquery.autocomplete.css" />
<script language="javascript" type="text/javascript" src="<?php echo $this->jconf['live_site']; ?>/components/com_mtree/templates/m2/autocomplete/jquery.autocomplete.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo $this->jconf['live_site']; ?>/components/com_mtree/templates/m2/autocomplete/jquery.js"></script>

<script type="text/javascript">
$().ready(function() {
    $("#course").autocomplete("<?php echo $this->jconf['live_site']; ?>/components/com_mtree/templates/m2/autocomplete/get_course_list.php", {
        width: 260,
        matchContains: true,
        //mustMatch: true,
        //minChars: 0,
        //multiple: true,
        //highlight: false,
        //multipleSeparator: ",",
        selectFirst: false
    });
});
</script>

In fact, I wish to use autocompletion in a field with research in the database.
My files work but I can't integrate them correctly into the field...

Do you have a solution for me please ?

Thank you.
  #2  
Old 05-27-2011, 02:08 AM
abdelkadermalki abdelkadermalki is offline
Mosets'd
 
Join Date: Oct 2010
Posts: 5
Default

Someone can help me? Please.
Up
  #3  
Old 06-02-2011, 12:54 AM
abdelkadermalki abdelkadermalki is offline
Mosets'd
 
Join Date: Oct 2010
Posts: 5
Default

Anyone ?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +8. The time now is 01:40 AM.

Copyright © 2005-2010 Mosets Consulting

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.