0

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 to pass the name of the item and list of ticked checkboxes to a .sh.

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.

shaded
  • 3
  • 1
  • 1
    Anyone who would like to offer support for this question, please comment/post at the crosspost on [Joomla Stack Exchange: Where do I add php code to submit an HTML form?](https://joomla.stackexchange.com/q/31651/12352) – mickmackusa Nov 11 '21 at 23:56
  • Evidently, [Stack Exchange does not like crossposting](https://meta.stackexchange.com/q/64068/352329). – mickmackusa Nov 12 '21 at 13:54
  • apparently so – shaded Nov 14 '21 at 16:47
  • I think that you should close this since you have it over at the [joomla.se] site.But I will say you are missing the whole idea of using a system like Joomla which provides you with the infrastructure to _safely_ build forms. – Elin Nov 14 '21 at 20:34
  • I've posted an answer on the crosspost on [Joomla Stack Exchange](https://joomla.stackexchange.com/questions/31651/where-do-i-add-php-code-to-submit-an-html-form/31674#31674) :) – A973C Nov 18 '21 at 11:11

0 Answers0