KoolReport's Forum

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

Creating a form with Inputs #1764

Closed Richb201 opened this topic on on Dec 15, 2020 - 5 comments

Richb201 commented on Dec 15, 2020

I need to create a form with Inputs. I need a radio button followed by 8 text fields. In looking through the documents I see:

            <?php
            RadioList::create(array(
                "name"=>"radioList",
                "dataStore"=>$this->dataStore("customers"),
                "dataBind"=>"customerName"
            ));
            ?>

My 2 radio choices don't need to come from a datastore. Rather I just need to hard code them.

For text fields, I think I can handle them, but an example would be nice. Any example of a simple form using inputs?

KoolReport commented on Dec 16, 2020

You try:

            <?php
            RadioList::create(array(
                "name"=>"radioList",
                "data"=>[
                       "John",
                       "Marry",
                ],
            ));
            ?>

or

            <?php
            RadioList::create(array(
                "name"=>"radioList",
                "dataStore"=>[
                    ["customerName"=>"John"],
                    ["customerName"=>"Marry"],
                ],
                "dataBind"=>"customerName"
            ));
            ?>
Richb201 commented on Dec 16, 2020

That worked great. Thx. This is what I finally used: <?php

        RadioList::create(array(
            "name"=>"radioList",
            "data"=>[
                   "Pharma Research Study Toolkit",
                   "Software Research Study Toolkit",
            ],
        ));
?>

What I'd like to do is instead of using the text "Pharma Research Study Toolkit", I'd like to use the logo for the Pharma Research Study Toolkit.m which I have at a path <script type="text/JavaScript"><img src="<?php echo base_url(); ?>assets/themes/default/images/new_blue_logo_sub240x240.png" style="float:left;margin-top:5px;z-index:5" alt="logo"/> </script>';

Is there any simple way to do this?

KoolReport commented on Dec 16, 2020

You do:

            "data"=>[
                   "Pharma Research Study Toolkit"=>"<img src='".base_url()."assets/themes/default/images/new_blue_logo_sub240x240.png' style='float:left;margin-top:5px;z-index:5' alt='logo'/>",
                   "Software Research Study Toolkit"=>"...",
            ],
Richb201 commented on Dec 16, 2020

you are fast! thx

KoolReport commented on Dec 16, 2020

You are welcome :)

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
help needed
solved

Inputs