What's new

Welcome to the forum 👋, Visitor

To access the forum content and all our services, you must register or log in to the forum. Becoming a member of the forum is completely free.

Open in new window

Joined
Jun 16, 2023
Messages
1
Reaction score
0
HTML Coins
0
I want to open my next file in a new window.
my code is
print("<form name='ReportsForm'action='window.open(HA_RptAcctStmt.php)' method='POST' onsubmit='return formcheck(ReportsForm)'>");}
It doesn't work but it seems to me it worked in the past.
Is there something wrong with action='window.open(HA_RptAcctStmt.php)'
 
The action attribute in the <form> tag is meant to specify where the form data should be sent after submission. It's not meant for JavaScript. What you're trying to do with the window.open() method should be in a JavaScript function, not inside the action attribute.

Here's a quick fix for ya:

Remove the window.open from the action attribute.
Add an event listener in your JavaScript to handle the form submission, and there you can pop the new window.

Here's how you can modify your code:

<script>
function openNewWindowAndSubmitForm() {
window.open('HA_RptAcctStmt.php', '_blank');
document.ReportsForm.submit();
return false; // prevent the default form submission
}
</script>

<form name='ReportsForm' action='HA_RptAcctStmt.php' method='POST' onsubmit='return openNewWindowAndSubmitForm();'>
 

Theme customization system

You can customize some areas of the forum theme from this menu.

  • Wide/Narrow view

    You can control a structure that you can use to use your theme wide or narrow.

    Grid view forum list

    You can control the layout of the forum list in a grid or ordinary listing style structure.

    Picture grid mode

    You can control the structure where you can open/close images in the grid forum list.

    Close sidebar

    You can get rid of the crowded view in the forum by closing the sidebar.

    Fixed sidebar

    You can make it more useful and easier to access by pinning the sidebar.

    Close radius

    You can use the radius at the corners of the blocks according to your taste by closing/opening it.

  • Choose the color combination that reflects your taste
    Background images
    Color gradient backgrounds
Back