Closed neurobox closed 7 years ago
Hi, You're right, but the anchor is useful as it allow to focus on the submitted form. If it's not off-screen and if you don't have several ones on the same page you can get rid of the action parameter (instead of an empty value). It should be fixed by using the absolute url of the page instead. Something like :
$url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$html = '<form action="' . $url . '#p01-contact' . $this->id . '" autocomplete="off" ';
Feel free to give it a try.
Hi I'm a bit of a git noob, but I'll contribute this... The form has appeared to stop working because instead of actually submitting to the same page, e.g. /contact-us/#p01contact, it goes to /#p01contact. I'm not sure what's behind this behavior, but found that it behaves correctly if you replace action="#p01contact" with just action="", which forces a reload of the same page.