KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Select input name as javascript function #1278

Closed iRiyada opened this topic on on Jan 30, 2020 - 4 comments

iRiyada commented on Jan 30, 2020

Hi, I want to know how to assign javascript function to select input name.

I tried this way. It does'nt work. please help. It says echo function not allowed.

<?php
Select2::create(array(
   __
    "name"=>  echo '<script type="text/javascript">
                                test();
                                 </script>'; __

    "defaultOption"=>array("--"=>""),                    
    "dataStore"=>$this->dataStore("section1"),
    "dataBind"=>array(
        "text"=>"name",
        "value"=>"id",
    ),
    "attributes"=>array(
        "class"=>"col-md-4 form-control"
    ),

));
?>
KoolReport commented on Jan 30, 2020

May I know why do you need to assign a javascript to the name of select box.

iRiyada commented on Feb 12, 2020

sorry.That was a mistake . What I meant was name of column..It is like this. The name of the column is set by calling a function, depending on If the page is arabic/english

"columns" => array(
            "project_code" => array(
                "label" => get_text('textbit'),
                  "cssStyle"=>"border-right:none;"
            ),

issue: 1) can I use php function call in the place of label

KoolReport commented on Feb 12, 2020

Yes, you can do so.

iRiyada commented on Feb 12, 2020

thank you:)

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
solved

None