1

I am new to Joomla, and so far, I used the basics to make a simple website. I decided to try out making a component, using JCB, that has a database of a list of items, and for each item, there is a list of checkboxes. What I want to do is submit the name of the item and the list of checked boxes to a bash script and run the bash script when I click on the submit button. But I do not know in which .php file I have to add the php function that will get called by the form action.

This is what my site view looks like for the checkboxes:

<form method="post">
<div class="btn-group" data-toggle="buttons">
<?php foreach ($this->items as $item): ?>
  <label class="btn btn-primary">
    <input type="checkbox" name="test[]" onClick="this.checked=!this.checked;"> <?php echo $item->testcase; ?>
  </label>
<?php endforeach; ?>
<input type="submit" name ="Submit">
</div>
</form>

Can anyone help me with this issue? I would essentially like to know where I can add a php function to act as the form action. Thanks, and let me know if I should provide any other details.

1
  • Welcome to JSE and thank you for posting a good first question. Please take our tour while you wait for support/feedback. Commented Nov 11, 2021 at 23:16

1 Answer 1

0

You can use Sourcerer Extension for Joomla available here: https://regularlabs.com/sourcerer.

This extension allows you to embed any HTML/CSS/JS/PHP on a simple article. To do so:

  1. Upload your script(s) on a folder inside your Joomla structure
  2. Create a new article with this content and publish it:

{source}<?php include JPATH_SITE.'/path/to/myfile.php'; {/source}

  1. Add a menu entrie of this article if you want :)
2
  • While this may be a viable solution, it is a little light on detail/implementation. Please be prepared to offer more specific guidance if the OP requests it. Commented Nov 18, 2021 at 12:45
  • thank you so much for your help A973C and especially mickmackusa. however i decided i would just work with what i know best, which is python, hence i am instead making a flask microserver to deal with the form. i know this is wasted potential of joomla, but i realized i cannot make use of these stuff without knowing php. sorry, and thanks again.
    – shaded
    Commented Nov 21, 2021 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.