You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function form_open(string $action = '', $attributes = [], array $hidden = []): string
{
// If no action is provided then set to the current url
if (! $action)
{
$action = current_url(true);
} // If an action is not a full URL then turn it into one
elseif (strpos($action, '://') === false)
{
$action = site_url($action);
}
I've got many use cases (with javascript) where I don't want to define action as an URL. Is it necessary to force make action attribute as URL ? I want to make my form works only when JS is enabled.
I'd like to propose sth like that:
function form_open(string $action = '', $attributes = [], array $hidden = []): string
{
// If no action is provided then set to the current url
if (! $action)
{
$action = current_url(true);
} // If an action is not a full URL then turn it into one
elseif (strpos($action, '#') !== 0 && strpos($action, '://') === false)
{
$action = site_url($action);
}
which allows strings begins from '#' to be a correct action for forms attribute
The text was updated successfully, but these errors were encountered:
I've got many use cases (with javascript) where I don't want to define action as an URL. Is it necessary to force make action attribute as URL ? I want to make my form works only when JS is enabled.
I'd like to propose sth like that:
which allows strings begins from '#' to be a correct action for
form
s attributeThe text was updated successfully, but these errors were encountered: