CodeIgniter Forums
"Action" attribute in the Form Helper - How to eliminate or disable 24.07.19 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: Model-View-Controller (https://forum.codeigniter.com/forum-10.html)
+--- Thread: "Action" attribute in the Form Helper - How to eliminate or disable 24.07.19 (/thread-74113.html)



"Action" attribute in the Form Helper - How to eliminate or disable 24.07.19 - Porto - 07-24-2019

Hi Guys greetings!

I've already read some post about this question, but i didn't still find a solution. The Posts that i read are from seven or teen years ago. Maybe we have something new with the latest is Version 3.1.10

1° I am using form helper library to load form in views.

2° How to eliminate or disable the "Action" attribute in the Form using the Form helper form_open('  '); please?

3° Ex: <form method="post" accept-charset="utf-8" action="">

4° Or Ex: <form method="post" accept-charset="utf-8">

5° If i use just empty 'single quotes' form_open('  '); the helper generate automatically the base_url and submit the form to the same file (controller/method) where the form is

6° Because i'm using a AJAX function, i would like continue to use the helper, but without the "action" attribute. Otherwise it's necessary to use the typical <form></form>

Thank you so much in Advance!


RE: "Action" attribute in the Form Helper - How to eliminate or disable 24.07.19 - ciadmin - 07-24-2019

You might try a hash sign as the action, which effectively disables it... form_open('#')


RE: "Action" attribute in the Form Helper - How to eliminate or disable 24.07.19 - Porto - 07-26-2019

(07-24-2019, 06:09 AM)ciadmin Wrote: You might try a hash sign as the action, which effectively disables it... form_open('#')

Hello Mr. Admin

Well, it works!

Thank you so much and i wish you have a nice weekend! ;  )