corsasport.co.uk
 

Corsa Sport » Message Board » General Chat » Need a bit of help (HTML) » Post Reply

Post Reply
Who Can Post? All users can post new topics and all users can reply.
Icon:
Formatting Mode:
Normal
Advanced
Help

Insert Bold text Insert Italicized text Insert Underlined text Insert Centered text Insert a Hyperlink Insert Email Hyperlink Insert an Image Insert Code Formatted text Insert Quoted text
Message:
HTML is Off
Smilies are On
BB Code is On
[img] Code is On
Post Options: Disable smileys?
Turn BBCode off?
Receive email notification of new replies?

Dom

posted on 5th Jan 04 at 22:48

quote:
Originally posted by PaulW
reet have uploaded the head file

also put a lil thanks in the code ;)

cheers! :thumbs:

not a problem mate :)


PaulW

posted on 5th Jan 04 at 22:42

quote:
Originally posted by VisibleMan
thing is mate, whats the point in having that button? as soon as you change the option box value it loads up the newsletter ;) so either drop the button or drop the onchange event :)

Also, note that vbscript isnt that good in other browsers :( So i would still look for a way to get it to work in javascript. Best bet mate, look it up on javascript.com or something, google etc :)


it'l do for now, everyone at work (the school) uses IE6, so as long as it works for them for now, I can work on sorting it out for other browsers soon


PaulW

posted on 5th Jan 04 at 22:41

reet have uploaded the head file

also put a lil thanks in the code ;)

cheers! :thumbs:


Dom

posted on 5th Jan 04 at 22:41

thing is mate, whats the point in having that button? as soon as you change the option box value it loads up the newsletter ;) so either drop the button or drop the onchange event :)

Also, note that vbscript isnt that good in other browsers :( So i would still look for a way to get it to work in javascript. Best bet mate, look it up on javascript.com or something, google etc :)


PaulW

posted on 5th Jan 04 at 22:35

just needed to change one thing tho

code:
<input type="button" name="news_view" value="View" onClick="MM_jumpMenuGo('archives_menu','parent',0)">



to

code:
<input type="button" name="news_view" value="View" onClick="OpenWin()">


PaulW

posted on 5th Jan 04 at 22:34

I've put your function in, works a treat & is much smaller :lol:

Cheers :thumbs:


Dom

posted on 5th Jan 04 at 22:32

<select name="archives_menu" onChange="MM_jumpMenu('_new',this,0)">

try that mate, might work :) although i can just work out javascript lol


PaulW

posted on 5th Jan 04 at 22:29

:lol: ok will give it a try cheers!


PaulW

posted on 5th Jan 04 at 22:29

Rite

got it now to open a popup correctly, but, the parent is also being changed. I've tried sending it to _blank & also completely removing the parent decleration, but doing that stops it working all together...

code:
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
window.open(eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"),'arch','scrollbars=yes,width=720,height=500');
if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}
//-->
</script>

<form name="form1">
<select name="archives_menu" onChange="MM_jumpMenu('parent',this,0)">
<option value="#" selected>-- Please Choose Newsletter --</option>
<option value="1002.htm">October 2002</option>
</select>
<input type="button" name="news_view" value="View" onClick="MM_jumpMenuGo('archives_menu','parent',0)">
</form>


Dom

posted on 5th Jan 04 at 22:29

Heres some vbscript and it works :)

Wack this inside the head tags -

code:

<Script language="vbscript">
Function OpenWin()
Dim strVal
strVal = form1.mnu.options(form1.mnu.selectedindex).value
If strVal <> "#" then
set popupWin = window.open(strVal,"NewsLetter","scrollbars=yes, width=720, height=500")
set popupWin = nothing
End If
End Function
</script>



Then change the selection box bit to this -
code:

<form name="form1">
<select name="mnu" onChange="OpenWin()">
<option value="#" selected>-- Please Choose Newsletter --</option>
<option value="1002.htm">Test1</option>
</select>
'repeat above for others
<input type="button" name="news_view" value="View" onClick="MM_jumpMenuGo('archives_menu','parent',0)">
</form>



Tested it here and it works :thumbs:


PaulW

posted on 5th Jan 04 at 22:15

aye just messin about with the code now


Ian

posted on 5th Jan 04 at 22:13

No, the MM_jumpMenu function has target as an input, should be very easy to specific a new window in there.


PaulW

posted on 5th Jan 04 at 22:04

tried piggybackin it but no joy so far, ill have another go & up it see if it works


Dom

posted on 5th Jan 04 at 22:03

thing is, paul has javascript in place already - when ya click on the little paper icon it popups with the newsletter. So basically you just piggy back the same code into the option (select) box :)


Ian

posted on 5th Jan 04 at 22:01

At a guess, find this line:

code:
<select name="archives_menu" onChange="MM_jumpMenu('parent',this,0)">


and change 'parent' to '_blank'

Or it might be 'this' wants changing to '_blank'. I'd have to know more about those functions.


Dom

posted on 5th Jan 04 at 22:00

you need abit of javascript or vbscript in there :thumbs:
Basically, when option box equals a certain value, which you set in the HTML option box value setting, goto here, etc :)

And btw, take the right-mouse click event off, if people want to nick your stuff they will, it doesnt protect you against anything ;)

edit: if you wack up the sorce code or sumthing i can write abit of vbscript to do it, but then it will only work in IE browsers :( Im not good at javascript :(

[Edited on 05-01-2004 by VisibleMan]


PaulW

posted on 5th Jan 04 at 21:52

Ok I need a bit of help with some code, I'm trying to get a drop down menu to open a page up in a new window like when clicking on the newsletters... but testing it on my machine, it opens the newsletter in the main window & not in a popup

is there anyway to get this to happen?? would be a great help thanks :D

page im trying to do it on is

http://stnicholas-school.org.uk/head/head.htm