Skip to content

when submitting the form from the formbuilder the hash(#) value get removed from the url

I’m trying to submit the request through the GET request by sending the fields as the query parameters, example.com/web/connector/#/home?(other query parameters) when the request is submitted the URL gets changed into this example.com/web/connector/?(other query parameters) the #/home gets removed from the URL while submitting the form through the formbuilder, I try to use the urlencode to change the special character to ASCII but it did not work.

        var form_template =
            '<form action="<%= data.action %>" method="GET" enctype="raw">' +
            '<% _.each(data.fields, function(val, key){ %>' +
            '<input value="<%= val %>" name="<%= key %>" type="hidden">' +
            '<% }); %>' +
            '</form>';

        return function (response) {
            var form = mageTemplate(form_template);
            var final_form = form({
                data: {
                    action: response.action, //notice the "action" key is the form action you return from controller
                    fields: response.fields //fields are inputs of the form returned from controller
                }
            });
            return $(final_form).appendTo($('[data-container="body"]')); //Finally, append the form to the <body> element (or more accurately to the [data-container="body"] element)
        }; ```