Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cant set this value

    Hello i have this js file
    Code:
    /* 
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    var page = 0;
    var pages = 0;
    var linhas = 0;
    var lines = 10;
    var DivTable = null;
    var DivPager = null;
    var PhpFile = null;
    var css = null;
    var pagercss = null;
    
    function setPhpFile(file)
    {
        this.PhpFile = file;
    }
    
    function setPage(page)
    {
        this.page = page;
    }
    
    function setPages(numberPages)
    {
        this.pages = numberPages;
    }
    
    function setDivTable(table)
    {
        this.DivTable = table;
    }
    
    function setDivPager(pager)
    {
        this.DivPager = pager;
    }
    
    function setStyle(style)
    {
        this.css = style;
    }
    function setPagerStyle(style)
    {
        this.pagercss = style;
    }
    function setRows(rows)
    {
        this.linhas = rows;
    }
    function getPhpFile()
    {
        return this.PhpFile;
    }
    function getPage()
    {
        return this.page;
    }
    function getPages()
    {
        return this.pages;
    }
    function getDivTable()
    {
        return this.DivTable;
    }
    
    function getDivPager()
    {
        return this.DivPager;
    }
    
    function getStyle()
    {
        return this.css;
    }
    function getPagerStyle()
    {
        return this.pagercss;
    }
    function LoadNumberRows()
    {
         $.ajax({
                type: "GET",
                url: "AjaxController.php",
                data: "action=GetNumberRows",
                dataType: "json",
                beforeSend: function(){
                },
                complete: function(){
                },
                success: function(msg){
                 setRows(msg[0].Count);
                }
            });
        }
    function gerNumberRows()
    {
        return this.linhas;
    }
    function CreateDinamicTable(arrHeader,style,divTable,divPager,pagerStyle,phpFile)
    {
        /********Seting Vars**********/
        setStyle(style);
        setDivTable(divTable);
        setDivPager(divPager);
        setPhpFile(phpFile);
        setPagerStyle(pagerStyle);
        LoadNumberRows(); //Here a function load the number of rows via ajax and set it to var linhas, but var linhas always stays 0
    Please help me.
    Last edited by jacastronunes; 08-25-2010 at 11:53 AM.

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,331
    Thanks
    13
    Thanked 348 Times in 344 Posts
    do you have a link?
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #3
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #4
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,331
    Thanks
    13
    Thanked 348 Times in 344 Posts
    how did you determine that linhas doesn’t change?
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #5
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    function gerNumberRows()
    {
        return this.linhas;
    }
    Because if i make an alert of getNumberRows it will return 0, that the value initialized on the var, i thinks that is has to do with returning inside a ajax response.

  • #6
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,331
    Thanks
    13
    Thanked 348 Times in 344 Posts
    getNumberRows() != gerNumberRows()
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #7
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sory, i didn't understand what you mean by that

  • #8
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,331
    Thanks
    13
    Thanked 348 Times in 344 Posts
    there is no getNumberRows() function, because the function is called gerNumberRows()
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #9
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have corrected the function name, but its returning 0 anyway.

    Code:
     /*************************/
         var divTable = getDivTable();
         var lines = getPageFilterValue();
         var page = getPage();
         if(getSearchMode() == true)
             {
                 dataToSend = getSearchText()+"&lines="+lines+"&page="+page;
             }
         else
             {
                 dataToSend = "action=Load&lines="+lines+"&page="+page;
             }
         $.ajax({
                type: "GET",
                url: this.dataFile,
                data: dataToSend,
                dataType: "json",
                beforeSend: function(){
                    $('#'+divTable).show();
                    $('#'+divTable).html('<img name="imgAjaxLoading3" id="imgAjaxLoading3" style="display: none;" alt="" src="">');
                    $('#imgAjaxLoading3').show();
                    $('#imgAjaxLoading3').attr("src","/images/loading2.gif");
                },
                complete: function(){
                    $('#imgAjaxLoading3').hide();
    
    
                },
                success: function(msg){
                    if(msg.length > 0)
                    {
                        var head = getArrayHeader().Header;
                        var genOpt = getArrayHeader().GeneralOptions;
                        setRows(msg[0].NumberRows);//Here i try to set the var linhas
                        var html = "<fieldset class=\"first\">"
                                   +"<legend> Resultado: "+msg[0].data.length+"</legend>";
                        html +="<div id='gen'><p style=\"textAlign:left\">";
                            if(genOpt[0].AllowSearch == "true")
                                {
                                    html +="<a href='javascript:Search()'><img src=\"AjaxTable/Images/search.gif\"/></a>";
                                }
                             if(genOpt[0].AllowAdd == "true")
                                {
                                    html +="<a href='javascript:Add()'><img src=\"AjaxTable/Images/add.gif\"/></a>";
                                }
                            html +="</p></div><font face=\"verdana\"><table cellspacing=0 cellpadding=0 id='dg' class='"+getStyle()+"' >"
                                 +"<tr>";
                        if(genOpt[0].BuildActions == "True")
                            {
                            html += "<td id='colActions' class='td-header' style='width:50px;' nowrap='true'>ACTIONS"
                            +"</td>"
                            }
                        for(i=0;i<head.length;i++)
                            {
                                innerStyle = "";
                                if(head[i].visible == "false")
                                    {
                                        innerStyle = "display:none;";
                                    }
                                if(head[i].width)
                                     {
                                        innerStyle += "width:"+head[i].width+";";
                                    }
                                html +=  "<td id='"+head[i]["Field"]+"' class='td-header' style='"+innerStyle+"' nowrap='true'>"+head[i]["Name"];
                                if(getSearchMode() == "false")
                                        {
                                           if(head[i].search == "true")
                                               {
                                                html +="<a href='javascript:Sort(\""+head[i].dataFieldName+"\",\"asc\")'><img src=\"AjaxTable/Images/arrowUp.gif\"/></a>&nbsp;<a href='javascript:Sort(\""+head[i].dataFieldName+"\",\"desc\")'><img src=\"AjaxTable/Images/arrowDown.gif\"/></a></td>";
                                               }
                                        }
                            }
                         html +="</tr>";
                         for(s=0;s<msg[0].data.length;s++)
                             {
                               var tdclass = "td-odd";
                                if(s%2==0)
                                {
                                    tdclass = "td-even";
                                }
                               html += "<tr id='data"+s+"'>"
                               if(genOpt[0].BuildActions == "True")
                                   {
                                    html +="<td class='"+tdclass+"' id='Actions"+s+"'>"
                                        +"<button onclick='delPath(\"data"+s+"\")' id=\"buttonDel"+s+"\" type=\"button\" style=\"width:20px;\">D</button>"
                                        +"<button onclick='editPath(\"data"+s+"\")' id=\"buttonEdit"+s+"\" type=\"button\" style=\"width:20px;\">E</button>"
                                        +"</td>"
                                   }
                                    for(i=0;i<head.length;i++)
                                    {
                                        innerStyle = "";
                                        if(head[i].visible == "false")
                                            {
                                                innerStyle = "display:none;";
                                            }
                                        if(head[i].width)
                                             {
                                                innerStyle += "width:"+head[i].width+";";
                                            }
                                       html +="<td class='"+tdclass+"' style='"+innerStyle+"' id='"+head[i].Field+s+"'>"+msg[0].data[s][head[i].dataFieldName]+"</td>";
    
                                     }
                                     html +="</tr>"
                                     }
                         html +="</table></fieldset>";
                    }else{
                        html="<fieldset class=\"first\"><legend><font class=\"smallblinkytext\">ERRO</font></legend><h1 class=\"blinkytext\">Erro a carregar dados<br>Por favor contacte o administrador de sistemas</h1></fieldset>";
                    }
                    $('#'+divTable).html(html);
                }
            });
    I have make and alert inside the function that need that value, but its still returning 0.
    I think that i cant return a value inside that ajax complete function :S

  • #10
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,331
    Thanks
    13
    Thanked 348 Times in 344 Posts
    I don’t see a getNumberRows() function in this code.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #11
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    /* 
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    var page = 1;
    var pages = 0;
    var linhas = 0;
    var DivTable = null;
    var DivPager = null;
    var DivSearch = null;
    var DivDel = null;
    var dataFile = null;
    var css = null;
    var pagercss = null;
    var arrheader = null;
    var searchMode = false;
    var pageFilterValue = 0;
    var firstPagerBuilt = false;
    var searchText = null;
    var searchFunction = null;
    
    function includes()
    {
        document.write('<script type="text/javascript" src="/js/DataPicker/ui/ui.core.js"></script>');
        document.write('<script type="text/javascript" src="/js/DataPicker/ui/ui.datepicker.js"></script>');
        document.write('<script type="text/javascript" src="/js/jquery.bgiframe.js"></script>');
        document.write('<script type="text/javascript" src="/js/ui/jquery.ui.core.js"></script>');
        document.write('<script type="text/javascript" src="/js/ui/jquery.ui.widget.js"></script>');
        document.write('<script type="text/javascript" src="/js/ui/jquery.ui.mouse.js"></script>');
        document.write('<script type="text/javascript" src="/js/ui/jquery.ui.position.js"></script>');
        document.write('<script type="text/javascript" src="/js/ui/jquery.ui.dialog.js"></script>');
        document.write('<script type="text/javascript" src="/js/ui/jquery.ui.dialog.js"></script>');
    
    }
    
    function setPage(page)
    {
        this.page = page;
    }
    function setPages(numberPages)
    {
        this.pages = numberPages;
    }
    function setDivTable(table)
    {
        this.DivTable = table;
    }
    function setDivPager(pager)
    {
        this.DivPager = pager;
    }
    function setStyle(style)
    {
        this.css = style;
    }
    function setPagerStyle(style)
    {
        this.pagercss = style;
    }
    function setRows(rows)
    {
        this.linhas = rows;
    }
    function setTableHeader(head)
    {
        this.arrheader = head;
    }
    function setDataFile(file)
    {
        this.dataFile = file;
    }
    function setSearchMode(value)
    {
        this.searchMode = value;
    }
    function setPageFilterValue(value)
    {
        this.pageFilterValue = value;
    }
    function setDivSearch(div)
    {
        this.DivSearch = div;
    }
    function setDivDel(div)
    {
        this.DivDel = div;
    }
    function setSearchtext(text)
    {
        this.searchText = text;
    }
    function setSeachFuntion(text)
    {
        this.searchFunction = text;
    }
    function getPage()
    {
        return this.page;
    }
    function getPages()
    {
        return this.pages;
    }
    function getDivTable()
    {
        return this.DivTable;
    }
    function getDivPager()
    {
        return this.DivPager;
    }
    function getStyle()
    {
        return this.css;
    }
    function getPagerStyle()
    {
        return this.pagercss;
    }
    function getArrayHeader()
    {
        return this.arrheader;
    }
    function getDataFile()
    {
        return this.dataFile;
    }
    function getSearchMode()
    {
        return this.searchMode;
    }
    function LoadNumberRows()
    {
         $.ajax({
                type: "GET",
                url: "AjaxController.php",
                data: "action=GetNumberRows",
                dataType: "json",
                beforeSend: function(){
                },
                complete: function(){
                },
                success: function(msg){
                 setRows(parseInt(msg[0].Count));
                }
            });
        }
    function getNumberRows()
    {
        return this.linhas;
    }
    function getPageFilterValue()
    {
        return this.pageFilterValue;
    }
    
    function getDivSearch()
    {
        return this.DivSearch;
    }
    function getDivDel()
    {
        return this.DivDel;
    }
    function getSearchText()
    {
        return this.searchText;
    }
    function getSearchFunction()
    {
        return this.searchFunction;
    }
    function CreateDinamicTable(arrHeader,style,divTable,divPager,pagerStyle,phpFile,divSearch,divDel)
    {
        /********Seting Vars**********/
        setStyle(style);
        setDivTable(divTable);
        setDivPager(divPager);
        setDataFile(phpFile);
        setPagerStyle(pagerStyle);
        setTableHeader(arrHeader);
        setDivSearch(divSearch);
        setDivDel(divDel);
        head = getArrayHeader().PageFilter;
         for(i=0;i<head.length;i++)
         {
             if(head[i].Selected == "true")
                 setPageFilterValue(head[i].Value)
         }
        showTable();
        BuildPager();
    }
    function showTable()
    {
         /*************************/
         var divTable = getDivTable();
         var lines = getPageFilterValue();
         var page = getPage();
         if(getSearchMode() == true)
             {
                 dataToSend = getSearchText()+"&lines="+lines+"&page="+page;
             }
         else
             {
                 dataToSend = "action=Load&lines="+lines+"&page="+page;
             }
         $.ajax({
                type: "GET",
                url: this.dataFile,
                data: dataToSend,
                dataType: "json",
                beforeSend: function(){
                    $('#'+divTable).show();
                    $('#'+divTable).html('<img name="imgAjaxLoading3" id="imgAjaxLoading3" style="display: none;" alt="" src="">');
                    $('#imgAjaxLoading3').show();
                    $('#imgAjaxLoading3').attr("src","/images/loading2.gif");
                },
                complete: function(){
                    $('#imgAjaxLoading3').hide();
    
    
                },
                success: function(msg){
                    if(msg.length > 0)
                    {
                        var head = getArrayHeader().Header;
                        var genOpt = getArrayHeader().GeneralOptions;
                        setRows(msg[0].NumberRows);
                        var html = "<fieldset class=\"first\">"
                                   +"<legend> Resultado: "+msg[0].data.length+"</legend>";
                        html +="<div id='gen'><p style=\"textAlign:left\">";
                            if(genOpt[0].AllowSearch == "true")
                                {
                                    html +="<a href='javascript:Search()'><img src=\"AjaxTable/Images/search.gif\"/></a>";
                                }
                             if(genOpt[0].AllowAdd == "true")
                                {
                                    html +="<a href='javascript:Add()'><img src=\"AjaxTable/Images/add.gif\"/></a>";
                                }
                            html +="</p></div><font face=\"verdana\"><table cellspacing=0 cellpadding=0 id='dg' class='"+getStyle()+"' >"
                                 +"<tr>";
                        if(genOpt[0].BuildActions == "True")
                            {
                            html += "<td id='colActions' class='td-header' style='width:50px;' nowrap='true'>ACTIONS"
                            +"</td>"
                            }
                        for(i=0;i<head.length;i++)
                            {
                                innerStyle = "";
                                if(head[i].visible == "false")
                                    {
                                        innerStyle = "display:none;";
                                    }
                                if(head[i].width)
                                     {
                                        innerStyle += "width:"+head[i].width+";";
                                    }
                                html +=  "<td id='"+head[i]["Field"]+"' class='td-header' style='"+innerStyle+"' nowrap='true'>"+head[i]["Name"];
                                if(getSearchMode() == "false")
                                        {
                                           if(head[i].search == "true")
                                               {
                                                html +="<a href='javascript:Sort(\""+head[i].dataFieldName+"\",\"asc\")'><img src=\"AjaxTable/Images/arrowUp.gif\"/></a>&nbsp;<a href='javascript:Sort(\""+head[i].dataFieldName+"\",\"desc\")'><img src=\"AjaxTable/Images/arrowDown.gif\"/></a></td>";
                                               }
                                        }
                            }
                         html +="</tr>";
                         for(s=0;s<msg[0].data.length;s++)
                             {
                               var tdclass = "td-odd";
                                if(s%2==0)
                                {
                                    tdclass = "td-even";
                                }
                               html += "<tr id='data"+s+"'>"
                               if(genOpt[0].BuildActions == "True")
                                   {
                                    html +="<td class='"+tdclass+"' id='Actions"+s+"'>"
                                        +"<button onclick='delPath(\"data"+s+"\")' id=\"buttonDel"+s+"\" type=\"button\" style=\"width:20px;\">D</button>"
                                        +"<button onclick='editPath(\"data"+s+"\")' id=\"buttonEdit"+s+"\" type=\"button\" style=\"width:20px;\">E</button>"
                                        +"</td>"
                                   }
                                    for(i=0;i<head.length;i++)
                                    {
                                        innerStyle = "";
                                        if(head[i].visible == "false")
                                            {
                                                innerStyle = "display:none;";
                                            }
                                        if(head[i].width)
                                             {
                                                innerStyle += "width:"+head[i].width+";";
                                            }
                                       html +="<td class='"+tdclass+"' style='"+innerStyle+"' id='"+head[i].Field+s+"'>"+msg[0].data[s][head[i].dataFieldName]+"</td>";
    
                                     }
                                     html +="</tr>"
                                     }
                         html +="</table></fieldset>";
                    }else{
                        html="<fieldset class=\"first\"><legend><font class=\"smallblinkytext\">ERRO</font></legend><h1 class=\"blinkytext\">Erro a carregar dados<br>Por favor contacte o administrador de sistemas</h1></fieldset>";
                    }
                    $('#'+divTable).html(html);
                }
            });
    }
    function BuildPager()
    {
           var linesFilter = null;
           head = getArrayHeader().PageFilter;
           linesFilter = "<div id=\"PagerFilter\">"
                         +"<select id=\"ddlPagerList\" name=\"ddlPagerList\">";
                     for(i=0;i<head.length;i++)
                         {
                             if(head[i].Value == getPageFilterValue())
                                 {
                                    linesFilter += "<option selected=\"\" value=\""+head[i].Value+"\">"+head[i].Value+"</option>";
                                 }else
                                     {
                                         linesFilter += "<option value=\""+head[i].Value+"\">"+head[i].Value+"</option>";
                                     }
                         }
    
            linesFilter +="</select><button onclick=\"ChangeLines()\" id=\"buttonShowPager\" type=\"button\">Filtrar</button>"
                        +"</div>";            
            lines = getPageFilterValue();
            alert(getNumberRows());
            numberRows = 105;
            if(numberRows%lines == 0)
                pages = (numberRows/lines);
            else {
    			pages = parseInt((numberRows/lines))+1;
    		}
            setPages(pages);
            html = "<table frame='box' rules='all' class='"+getPagerStyle()+"'>"
                    +"<tbody><tr>";
            if(page == 1)
             {
                html += "<td class='Back-admintable-ON'> &lt;&lt; </td>";
              }else {
                   html += "<td class='Back-admintable'><a href='javascript:changePage(\""+lines+"\",\""+(parseInt(page)-1)+"\")';>  &lt;&lt; </a></td>";
              }
            if(pages > 1)
            {
                for(i=1;i<=pages;i++)
                    {
                        if(i==page)
                            {
                                html += "<td class='Number-admintable-ON'>"+i+"</td>";
                            }else{
                      html += "<td class='Number-admintable'><a href='javascript:changePage(\""+lines+"\",\""+i+"\")';>"+i+"</a></td>";
                      }
                    }
            }
             if(page == pages)
             {
                html += "<td class='Back-admintable-ON'> &gt;&gt; </td>";
              }else {
                   html += "<td class='Back-admintable'><a href='javascript:changePage(\""+lines+"\",\""+(parseInt(page)+1)+"\")';>  &gt;&gt; </a></td>";
              }
                 html += "<td class='Back-admintable'><a href='javascript:changePage(\""+numberRows+"\",\"1\")';>  View ALL </a></td>";
                 html +="</tr></tbody></table>";
           if(lines >= numberRows)
               $("#"+getDivPager()).html(linesFilter);
           else
               $("#"+getDivPager()).html(linesFilter+html);
        }
    function changePage(lines,page)
    {
        setPage(page);
        setPageFilterValue(lines);
        BuildPager();
        showTable();
    }
    function ChangeLines()
    {
        var pagerVal = $("#ddlPagerList option:selected").val();
        setPage(1);
        setPageFilterValue(pagerVal);
        BuildPager();
        showTable();
    
    }
    function Search()
    {
        html = "<fieldset class=\"first\"><legend>Pesquisar</legend>";
             var head = getArrayHeader().Header;
        for(i=0;i<head.length;i++)
            {
                if(head[i].search == "true")
                    {
                    html +="<fieldset class='second'><legend>"+head[i].Name+"</legend>"
                          +"<input type='text' size='31' maxlength='255' id='ddl"+head[i].Name+"' name='ddl"+head[i].Name+"'";
                      if(head[i].searchOptions[0].AutoComplete == "true")
                          {
                            html +="onkeyup=\"autoFill('ddl"+head[i].Name+"','"+head[i].dataFieldName+"','AutoComplete"+head[i].Name+"','"+head[i].searchOptions[0].AutoCompleteFunction+"')>"
                                 +"<div id='AutoComplete"+head[i].Name+"' class='clientList'></div></fieldset>";
                             setSeachFuntion(head[i].searchOptions[0].searchFunction);
                          }else{
                              html +=">";
                          }
                    }
            }
           html += "</fieldset>";
              $("#"+getDivSearch()).html(html);
              $("#"+getDivSearch()).dialog({
                resizable: false,
                modal: true,
                title: "<strong>Pesquisa</strong>",
                closeOnEscape: false,
                buttons: {
                    'Pesquisar': function() {
                        setSearchMode(true);
                        showTable();
                        $(this).dialog('close');
    
                    },
                    'Cancelar': function() {
                        $(this).dialog('close');
                    },
                    'Limpar': function() {
                        setSearchMode(false);
                        showTable();
                        $(this).dialog('close');
                    }
                }
            });
         $("#"+getDivSearch()).dialog("open");
    }
    
     function autoFill(htmlField,dataField,div,autoCompleteAjaxFunction)
        {
            $.ajax({
                type: "GET",
                url: "AjaxController.php",
                data: "action="+autoCompleteAjaxFunction+"&text="+$("#"+htmlField).val(),
                dataType: "json",
                beforeSend: function(){
                    var pos = $("#"+htmlField).offset();
                    var width = $("#"+htmlField).width();
                    var heigth =  $("#"+htmlField).height();
                    //show the menu directly over the placeholder
                    $("#"+div).css( {"left": (pos.left) + "px", "top":pos.top+heigth+2 + "px"} );
                    $("#"+div).show('medium');
                    $("#"+div).html('<img name="imgAjaxLoading3" id="imgAjaxLoading3" style="display: none;" alt="" src="">');
                    $('#imgAjaxLoading3').show();
                    $('#imgAjaxLoading3').attr("src","/images/loading2.gif");
                },
                complete: function(){
                    $('#imgAjaxLoading3').hide('medium');
                },
                success: function(msg){
                    var html2 = "";
                    for(i=0;i<msg.length;i++)
                    {
                        var name = msg[i][dataField];
                        html2 += "<a href='javascript:void(0)' onclick=\"complete('"+htmlField+"','"+div+"','"+name+"')\">"+name+"</a><br>";
                    }
                    $("#"+div).html(html2);
                }
            });
    
        }
        function complete(htmlField,div,value)
        {
            $('#'+htmlField).val(value);
            $('#'+div).hide('slow');
            var text = "action="+getSearchFunction()+"&Field="+value;
            setSearchtext(text);
        }

    I have posted all the code inside this js file im developing


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •