Menu

Submit button for form created with FormUIBlockFactory?

2024-03-27
2024-03-27
  • Jacques Dancause

    Hey there,

    I'm trying to create a custom form. I've gotten the hang of adding sub blocks and such, and I've been able to find existing examples of a few elements, such as dropdowns and how to populate them.

    I've set the form's action with $form->SetAction('filename.php'), but I'm trying to create the submit button and I can't quite figure it out (Short of just making a new Html('<input type="submit">')). Is there another built in way to do this?

     
  • Stephen Abello

    Stephen Abello - 2024-03-27

    Hi,

    There's Buttons UIBlock, you can check in ButtonUIBlockFactory the static method MakeForPrimaryAction, it takes these parameters string $sLabel, string $sName = null, string $sValue = null, bool $bIsSubmit = false, ?string $sId = null. I think the fourth parameter , bIsSubmit is what you're looking for.

    Hope this helps!

    Regards
    Stephen

     
    👍
    1

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.