Jump to content

Looking for Basic help with script


LASNera

Recommended Posts

I'm trying to get a script to read information from a link in a document and use it

to open a pop-up window with the url from the link.

There are 50 different links on this page that all need to open individual popups

on user request.

 

Can someone tell me what I'm doing wrong?  I tried to do it using form objects,

because I really couldn't figure out how to do it from a text link, although I

assume that is also possible and is what I really wanted to do.

Here's what I tried, I know it's off, but I don't know why - I'm still learning javascript.

I'd really appreciate any help, thanks:

 

in head:

< script >

function squadId (){

    var sq = document.squads.button.value;

    var i = sq + .html

    settings='width=350,height=400,location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,

          resizable=yes,fullscreen=no'

    doIt = window.Open ('i','Squadlistings',settings);

    doIt.focus();

}

< /script >

 

in body:

 

<form action="" method="post" name="squads" id="squads">

 

<TD HEIGHT="30" WIDTH="110" align="center" class="sqtext">

<a href=""><input type="button" name="BD" id="BD" value="Blue Devils" onClick="javascript:squadId()";></a></TD>

 

 

If anyone can correct this, or better, tell me how to do this with just text links, I'd be most grateful.

I believed there must be some way to have it get the info from the link instead of putting window.open functions

in every link on the page, right?

 

Thanks!!!

 

Link to comment
https://forums.phpfreaks.com/topic/87981-looking-for-basic-help-with-script/
Share on other sites

as far as using forms... no... you either need to get info the way you are... or... use form submissions...

 

however... if you were to just <a href="yourpage.html?squad=blue devils">LINK</a> you could then pick that up on the other side without a form :-)

 

 

<script>
function squadId (){
var i = document.squads.button.value+'.html'
settings='width=350,height=400,location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=yes,fullscreen=no'
doIt = window.Open(i,'Squadlistings',settings);
doIt.focus();
}
< /script >

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.