new window forms?

  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

im trying to figger out how to make it when u submit a form it will open in a new window WITH certen dimentions i wondering if i could do this throght java or java script what everone i would use, right know all i have is
Code: [ Select ]
<form action='music.php' method='post' target='_new'>

if you can help me it would be great!

~SpooF~
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Managedlinks
  • Proficient
  • Proficient
  • Managedlinks
  • Posts: 294

Post 3+ Months Ago

You will need to create the window using javascript, once created youi can send the output to it


I havent tried it but this is where I would start

Code: [ Select ]
<form action='music.php' method='post' target='mywin' onsubmit="openmywin();return true">


the javascript for openmywin would go something like this...

Code: [ Select ]
<script language="JavaScript">
function openmywin()
{
window.open('','mywin','width=200,height=350,location=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes');
}
</script>
  1. <script language="JavaScript">
  2. function openmywin()
  3. {
  4. window.open('','mywin','width=200,height=350,location=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes');
  5. }
  6. </script>



at a guess popup blockers will cause the window to open as a normal window

trial and error is definately required
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

I just tried something very similar and it worked for me:

Code: [ Select ]
<script type="text/javascript">
<!--
function pop(f) {
    window.open('', 'newWin','width=200,height=200');
    f.target='newWin';
    return true;
}
// -->
</script>
  1. <script type="text/javascript">
  2. <!--
  3. function pop(f) {
  4.     window.open('', 'newWin','width=200,height=200');
  5.     f.target='newWin';
  6.     return true;
  7. }
  8. // -->
  9. </script>


Code: [ Select ]
<form action="music.php" method="post" onsubmit="pop(this)">
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

okay thanks ill try those
  • s15199d
  • Expert
  • Expert
  • User avatar
  • Posts: 524
  • Loc: NC, USA

Post 3+ Months Ago

Code: [ Select ]
//open new window in contained size
    function openURL(sURL){
        window.open(sURL,null,"height=475,width=590,top=0,left=50,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
    }
  1. //open new window in contained size
  2.     function openURL(sURL){
  3.         window.open(sURL,null,"height=475,width=590,top=0,left=50,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
  4.     }


this way when you call the function you can pass a URL to the funciton like this

Code: [ Select ]
<a href="javascript: openURL('http://www.ozzu.com');">click here</a>

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 92 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.