This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

webmaster
webmaster

Hello,

I want to know how can I add a button on form and when click on that show specified form and submit it.

for example for publish button I add following code on update.htm


        button
                type="button"
                data_request="onPublish"
                data_hotkey="ctrl+p, cmd+p"
                data_load-indicator="Publishing..."
                data_request-confirm="Do you really want to publish this post?">
                class="btn btn-warning">
            Publish
        /button

and add following code to controller:


    public function onPublish(){
        flash::info('test');
        return [
            'partialContents' => $this->makePartial('ajax_publish', [
                'var' => 'value'
            ])
        ];
    }

I want to know how can I show _ajax_publish.htm after onPublish function run as result? in addition how can I show form with specified field when use click on publish button and so submit their input like relation partials?

thanks

p.s: I change some dash with underline and remove < on first code because it's translate to button after submition...

Last updated

webmaster
webmaster

if find a solution. but new problem is after 5 second loading popup is gone! OnPublish function need more than 15 second for download remote data and etc... what should I do on this situation?

why no one answer to questions!

dont' need to answer. I found solution!

it occure because of flash::info() and echo!

Last updated

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.