Advanced Hover Settings

Advanced Hover Settings For Joomla Website Builder Gridbox
Mon. - Fri. 9 am - 5 pm Ask a Question
Remember me

PHP Script not working on Form Submit Button

3 weeks 5 days ago #1

  • Mile3's Avatar
  • Mile3
  • Posts: 7
I am trying to set a variable value on form submit, but I cannot get it to work. As a matter of fact, I can't get any PHP code to work on the form.

Even the simplest script -- echo "Hello World"; -- doesn't show anything.

Is there some step I am perhaps missing?

3 weeks 5 days ago #2

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 19688
Hello,
Thank you for contacting us

Such code will not work as it is executed in parallel with the form submission.

Best Regards,
Vyacheslav, Balbooa Support Team

3 weeks 5 days ago #3

  • Mile3's Avatar
  • Mile3
  • Posts: 7
Thank you. Then my question is, what type of PHP code DOES work, if any?

Or is there a JavaScript API I could tie into to alter the page html after submit?

3 weeks 5 days ago #4

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 19688
You can see an example of the code that works in this post.
support.balbooa.com/forum/joomla-forms/1...-an-api-or-url#64436


Best Regards,
Vyacheslav, Balbooa Support Team

3 weeks 5 days ago #5

  • Mile3's Avatar
  • Mile3
  • Posts: 7
Thanks Vayacheslav. That post is helpful for understanding the logic.

However, my question is about the last part of your example:

// Do something if the data were sent successfully
if ($response->code == 200)
{
// Your code..
}

What operations are allowed in the "Your code" area? I'm unable to get php to do anything basic... not a page refresh, not echo text... Is there a set of actions that are allowed/disallowed?

3 weeks 5 days ago #6

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 19688
No restrictions, just no visual action will be seen

Best Regards,
Vyacheslav, Balbooa Support Team
Powered by Kunena Forum