1

I am making form with submit button in Joomla custom HTML and I would like to stay on the same page after I click on the submit button.

Is that possible? Thanks in advance.

raspucin_22
  • 35
  • 2
  • 5

2 Answers2

1

Just leave the form action attribute out. This will post back to the same page. Have a look at this question and answer: Is it a good practice to use an empty URL for a HTML form's action attribute? (action="")

Community
  • 1
  • 1
Martin
  • 10,294
  • 11
  • 63
  • 83
0

If "stay on the page" means that the page will not reload, or anoter page will be loaded, yes, thats quite possible. I think the best way of doing this is replacing the <input type=submit> with a <button>, which calls a javascript function that evaluates the form, submits the data via ajax, and notifies the user that the form was successfully submitted.

Ahti
  • 1,420
  • 1
  • 11
  • 20