Adjaime / php-form-builder-class

Automatically exported from code.google.com/p/php-form-builder-class
GNU General Public License v3.0
0 stars 0 forks source link

Problem with bootstrap typeahead #196

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

The bootstrap typehead feature doesn't work with PHP Form Builder Class because 
of this : 

    protected function renderJS() {
        $this->renderJSFiles(); 

        echo '<script type="text/javascript">';
        $this->view->renderJS();
        foreach($this->_elements as $element)
            $element->renderJS();

        $id = $this->_attributes["id"];

        echo 'jQuery(document).ready(function() {';

        /*When the form is submitted, disable all submit buttons to prevent duplicate submissions.*/
        echo <<<JS
        jQuery("#$id").bind("submit", function() { 
            jQuery(this).find("input[type=submit]").attr("disabled", "disabled"); 
        });
JS;

I justed added 

    if(!in_array("typeahead", $this->prevent)) before inserting the JS to fix it

Original issue reported on code.google.com by guillaum...@cg973.fr on 26 Feb 2013 at 12:28

Attachments: