Add control to modal

Add control to modal

weskeyweskey Posts: 12Questions: 5Answers: 0

I'd like to add a checkbox inside the create modal in the footer with the submit button. Id like to use the value of the checkbox to alter the behaviour of the submit button.

Anyone point me in the right direction?

Answers

  • colincolin Posts: 15,210Questions: 1Answers: 2,592

    Hi @weskey ,

    You could do something like this here, then check the value in the Editor events.

    Hope that helps,

    Cheers,

    Colin

  • weskeyweskey Posts: 12Questions: 5Answers: 0

    Hi Colin

    Thanks for your response. What I was after ideally was a checkbox control in the modal footer next to the create button. Any idea how I can add the control there?

    Thanks

  • allanallan Posts: 62,333Questions: 1Answers: 10,228 Site admin

    To do exactly what you want you'd need to listen for the open event and remove the Button Editor has added for the submit, replacing it with your own checkbox and button (which in turn could call submit() or any other method(s) you need).

    Alternatively, a simpler option would be to have two different submit buttons, which is possible through the buttons() method or form-options object (during initialisation - formOptions.main).

    Allan

This discussion has been closed.