custom button that open new tab issue

larryk

Well-known member
Hello,

I have a custom button that opens a 'new' browser tab via javascript. All good.

EXCEPT, the page where the button was located is NOW BLANK. How to prevent this from happening?

Can the custom button "only" open the new tab without changing its current page?

thanks


You are using DaDaBIK version 10.2-Manarola enterprise, installed on 08-18-2020 (installation code: 157025efd31de5bb7d), the latest version of DaDaBIK is 10.5-Manarola released on 01-14-2021

PHP Version: 7.2.34

mysql version: 5.5.68-MariaDB

Web server: nginx/1.16.1
 

larryk

Well-known member
surely there has to be a simple way to open a custom/dynamic URL in new window... where the link or button is on an edit form page
that DOES NOT change the current page when you click the button/link?

I can't be the only person to need this simple functionality?
 

larryk

Well-known member
solution BUT still an issue?

$hooks['PageName']['edit_form_header']['after'] = 'dadabik_display_info';
function dadabik_display_info()
{
global $conn, $dadabik_main_file, $current_user;

echo 'Get Info';
echo '<script type="text/javascript">
function myFunc() {
window.open("HERE'.$_GET["Email"].'THERE","popUpWindow","height=500, width=500, left=500, top=500, scrollbars=yes");
};
</script>';
}


so the issue...
get email is not returning any value?????

I'm guessing layout_hooks.php doesn't access the input fields???
 

larryk

Well-known member
post and get only for form submit...

go all javascript with this:
var vemail = document.getElementById("Email");

or
var vemail = document.getElementById("Email").value;

vemail is blank?
 
Top