Where is the OpenCart form action url - forms

I am using OpenCart 3.0.2.0. Where is the form action path in OpenCart Twig file?
Here is some of the code:
<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-product" class="form-horizontal">
I don't know where this action comes from.

You can go to the admin directory
Path :
admin\controller\catalog\product.php
and find
$data['action']
you can see it for action in view files as well.

Related

Codeigniter 4 form action path

sorry for the very noob question. I have a page : www.example.com/edit/3 with form inside.
<form class="" action="" method="post">
Usually my form action I will specify something like add, register, etc. In this case, I am not sure how do I specify it. Currently it is working when I save it if I leave it blank without specifying anything. But I am not sure is this the right way to do it.
Controller
public function edit_game(){}
Routes
$routes->match(['get', 'post'], 'account/edit_game/(:num)', 'Addgame::edit_game/$1');
Can anyone advise?
action="" is the URI to which send the form data, aka the controller where you treat the received data. If not specified, it will be the same page as the one you are currently on.
What you can do:
<form method="post">
</form>
<form method="post" action=""> <!-- same as previous -->
</form>
<form method="post" action="/some/page">
</form>
In the last example, note the leading /, it means it is according to the site root. If you forget it, it will be relative to the current URI.
Exemple, if the page containing the <form> is http://example.com/edit/3:
action="/some/page" will redirect to http://example.com/some/page.
action="some/page" will redirect to http://example.com/edit/some/page

How to solve this form action problem in code igniter?

CodeIgniter form action causes problem.
When I write below action URL without index.php it runs fine on Chrome and not on firefox
<form method="POST" action="Login/Loginme">
But When I write below action URL with index.php it does not run on chrome and run on firefox.
<form method="POST" action="index.php/Login/Loginme">
use site_url();
<form method="POST" action="<?php echo site_url('Login/Loginme'); ?>">
Using base_url() followed by the controller is best practice. eg. base_url('myController/myFunction')

Display multiple adminForm's in joomla

When creating a custom view in joomla with multiple forms, there is a conflict because each form has the id="adminForm" name="adminForm".
Renaming the form causes incompatibility with joomla.
How can I display multiple adminForm's on a single view?
Restructure the form elements into a single page-encompassing form
and remove the &task=controller.task portion from the form action
URL, e.g.
<form
action="<?php echo JRoute::_(''); ?>"
name="adminForm" id="adminForm" class="form-validate"
method="post" enctype="multipart/form-data">
On each submit button use the joomla method: onclick="Joomla.submitbutton('controller.task')" e.g.
<button type="submit"
onclick="Joomla.submitbutton('group.join')">Join</button>
Joomla will automatically update a hidden field with the name="task" and value="controller.task" which will get submitted with the form.
You need to have this element in your form for it to work, e.g.
<input type="hidden" name="task" value="" />
</form>

WordPress : Redirect a form validation & submit

What would be the best way to redirect a form after validation & submit? The form isn't a plugin, it's part of a theme.
a) This is the form action code:
<form action="" id="pro_form" enctype="multipart/form-data" method="post">
b) Here's the validation string:
<input type="submit" onclick="return validation()" value="Submit" >
Any help would be appreciated. Thanks!
Peter
I am not sure if this is want you are asking for, but in my opinion the best way is using javascript, like this:
echo '<script type="text/javascript">window.location ="NewLocation";</script>';
Place this code after the form returns from validation.

How to apply target value in zend form?

I have the same requirement like PHP + POST an HTML form from inside an iFrame and redirect parent
<form action".." target="_top">
</form>
I am using zend,I have to apply target="_top" in zend form. How can i do this in zend from
I found it by use ,
$this->setAttrib('target', '_top');