shaded
shaded

Reputation: 3

Where do I add php code to submit an HTML form in a Joomla component?

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.

Upvotes: 0

Views: 268

Answers (0)

Related Questions