i am making a html page,but i do not know how to open 2 sites when i click then command button,for e.g,when i click "OK" button,it will link to myfavourite.html and myhobby.html
Please help me,
tHANK YOU VERY MUCH
Printable View
i am making a html page,but i do not know how to open 2 sites when i click then command button,for e.g,when i click "OK" button,it will link to myfavourite.html and myhobby.html
Please help me,
tHANK YOU VERY MUCH
how do you want it to go to two pages? one in the main window and one in the popup?
location.href = "mypage.html" will use the main window
window.open("weee","myotherpage.html") will open a popup.
Are you looking for something like this?
Code:<a target="_blank" href="newwindow.html">
<input type="button" onclick="window.location='newpage.html'">
</a>
but i will put this code below <form action ...> or where?
You don't have to put it in there. You don't even need <form action ....>
Phreak
Here a solution!
<?xml version="1.0" encoding="windows-1253"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1253" />
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body>
<form name="form1" id="form1" method="post" action="">
<input name="Submit" type="submit" onclick="MM_openBrWindow('newwindow.html','','width=800,height=600');MM_openBrWindow('myotherpage.ht ml','','width=800,height=600')" value="Submit" />
</form>
</body>
</html>
I made it with dreamweaver MX 2004! This opens two windows and loads
1: newwindow.html
2: myotherpage.html
Is it fine for you?
i dont know Dreamweaver MX
I only know HTML in MS frontpage
Could you please help me this:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<form method="POST" action="--WEBBOT-SELF--">
<a target="_blank" href="www.vbforums.com">
<input type="button" onclick="window.location='www.vnn.vn'">
</a>
</form>
</body>
</html>
I take this code from Visual AD,but it dosent work
Please help me
Quote:
Originally posted by DarkX_Greece
Here a solution!
<?xml version="1.0" encoding="windows-1253"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1253" />
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body>
<form name="form1" id="form1" method="post" action="">
<input name="Submit" type="submit" onclick="MM_openBrWindow('newwindow.html','','width=800,height=600');MM_openBrWindow('myotherpage.ht ml','','width=800,height=600')" value="Submit" />
</form>
</body>
</html>
I made it with dreamweaver MX 2004! This opens two windows and loads
1: newwindow.html
2: myotherpage.html
Is it fine for you?
i thank you very much,but i dont know dreamwave mx
can you help me in MSfrontpage?
The code I gave you works in Netwscape and Firefox, but not Internet Explorer. Silly me for not testing - I might have known it would break in IE.
The reason for it not working is becuase the event is not bubbling properly. When you click on the bitton the click event for the button shoud bubble up to the <a> element but in IE it doesn't.
The following does work however, with just a hyperlink. You could insert an image of a button in place of the text:
The reason I havn't use the window.open method is because too many people have popup blockers which stop the windows from opening. Therefore it is a lot easier to steer clear of this method.Code:<a target="_blank" href="www.vbforums.com" onclick="window.location='www.vnn.vn'">link text - could be an image of a button
</a>
Why don't you just open another Internet Explorer (or other Browser)?
PhreakCode:<html>
<head>
<script type="text/javascript">
var Shell = new ActiveXObject("wscript.shell");
Shell.run("iexplore http://www.othersite.com/");
document.location="http://www.site.com/";
</script>
</head>
</html>
Wouldn't work too well in Netscape or Mozilla though.Quote:
Originally posted by «°°phReAk°°»
Why don't you just open another Internet Explorer (or other Browser)?
PhreakCode:<html>
<head>
<script type="text/javascript">
var Shell = new ActiveXObject("wscript.shell");
Shell.run("iexplore http://www.othersite.com/");
document.location="http://www.site.com/";
</script>
</head>
</html>
HTML (and JavaScript) is the same no matter which package you use to create it.Quote:
Originally posted by phanbachloc
i thank you very much,but i dont know dreamwave mx
can you help me in MSfrontpage?
Something written in one can be opened in another perfectly well.
VisualAd:
It uses Shell to execute it, so as long as you have this:
It will open it in the default browser. Give it a try..Code:Shell.Run("http://www.vbforums.com");
Phreak
excpet it will only work in IEQuote:
Originally posted by «°°phReAk°°»
VisualAd:
It uses Shell to execute it, so as long as you have this:
It will open it in the default browser. Give it a try..Code:Shell.Run("http://www.vbforums.com");
Phreak
I thought that Access to shell via Javascript/VBscript was only allowed with security turned off?Quote:
Originally posted by «°°phReAk°°»
VisualAd:
It uses Shell to execute it, so as long as you have this:
It will open it in the default browser. Give it a try..Code:Shell.Run("http://www.vbforums.com");
Phreak
If that works on your browser then I suggest you review your security settings. Becuase not only can the run method run any program on your system, it can also read/moidfy registry settings, execute processes, simulate key strokes and more.Quote:
Originally posted by «°°phReAk°°»
VisualAd:
It uses Shell to execute it, so as long as you have this:
It will open it in the default browser. Give it a try..Code:Shell.Run("http://www.vbforums.com");
Phreak
No website should eever be able to to create an instance of the shell object and VB Script in IE does not allow it by default for very good reasons.
No no, a warning comes up. He asked, we replied. I do realise how it can be used..
Phreak
<a target="_blank" href="www.vbforums.com" onclick="window.location='www.vnn.vn'">link text - could be an image of a buttonQuote:
Originally posted by visualAd
The code I gave you works in Netwscape and Firefox, but not Internet Explorer. Silly me for not testing - I might have known it would break in IE.
The reason for it not working is becuase the event is not bubbling properly. When you click on the bitton the click event for the button shoud bubble up to the <a> element but in IE it doesn't.
The following does work however, with just a hyperlink. You could insert an image of a button in place of the text:
The reason I havn't use the window.open method is because too many people have popup blockers which stop the windows from opening. Therefore it is a lot easier to steer clear of this method.Code:<a target="_blank" href="www.vbforums.com" onclick="window.location='www.vnn.vn'">link text - could be an image of a button
</a>
</a>
how can i put a command button instead of "link text-could be an image of a button?
I am beginer in html so i am very bad,please help me!
What I am saying is that it is difficult to do without it breaking in some browsers. Your main aim is to get a link to open in a blank window and also in the current window.
The HTML I gave you will work in the majority of modern day browsers as long as Javascript is enabled. If you put a button in there then it will cause the HTML to break in IE. If you use the window.location method, most users won't have the blank window open becuase of their popup blockers.
If your button is just opening a couple of links and is not a submit button on a form then you can do the follwoing with CSS to make it look and behave like a button. Give this a try:
This has been tested in Firefox/Netscape 7.1 and IE 6Code:<html>
<head>
<style type="text/css">
.up {
text-decoration: none;
font: Caption;
cursor: Default;
color: ButtonText;
border-width: 3px;
border-style: outset;
background-color: ButtonFace;
padding: 2px;
}
.down {
text-decoration: none;
font: Caption;
cursor: Default;
color: ButtonText;
border-width: 3px;
border-style: inset;
background-color: ButtonFace;
padding: 2px;
}
</style>
</head>
<body>
<a target="_blank" href="www.vbforums.com" class="up"
onclick="window.location='www.vnn.vn'"
onmousedown="this.className='down'"
onmouseout="this.className='up'"
onmouseup="this.className='up'">Click Me</a>
</body>
</html>
my english is so bad so i cant express my idea clearly.
I thank you for your help,you are the very good friends.
I mean all along as following:
+please visit:
http://www.sfu.ca/acs/sfuwebhelp/egform.htm
+Could you please telling me how to open another site ,for eg: www.vnn.vn when we click Send Form button? and the letter will also be sent at the same time?
PLEASE HELP ME ONCE AGAIN
I really don't see how that function would be better than window.open ...Quote:
Originally posted by DarkX_Greece
Here a solution!
<?xml version="1.0" encoding="windows-1253"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1253" />
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body>
<form name="form1" id="form1" method="post" action="">
<input name="Submit" type="submit" onclick="MM_openBrWindow('newwindow.html','','width=800,height=600');MM_openBrWindow('myotherpage.ht ml','','width=800,height=600')" value="Submit" />
</form>
</body>
</html>
I made it with dreamweaver MX 2004! This opens two windows and loads
1: newwindow.html
2: myotherpage.html
Is it fine for you?
Cheers!
it infact is the window.open function.Quote:
Originally posted by vbNeo
I really don't see how that function would be better than window.open ...
Cheers!
To the original poster, I think you need to take some basic HTML lessons. try http://www.w3schools.com/html/default.asp
or:
http://www.htmlgoodies.com/primers/basics.html
If you are submitting the form then it is a different story. The majority of popup blockers will not block popups generated by form submit events. You can therefore use the following HTML and be safe in the mind that it will work in all browsers except those without Javascript disabled:Quote:
Originally posted by phanbachloc
my english is so bad so i cant express my idea clearly.
I thank you for your help,you are the very good friends.
I mean all along as following:
+please visit:
http://www.sfu.ca/acs/sfuwebhelp/egform.htm
+Could you please telling me how to open another site ,for eg: www.vnn.vn when we click Send Form button? and the letter will also be sent at the same time?
PLEASE HELP ME ONCE AGAIN
Code:<html>
<body>
<form action="test.html" method="post" onsubmit="window.open('http://www.vnn.vn');">
Test input: <input type="text" /><br />
<input type="submit" value="Submit Form">
</form>
</body>
</html>
now that's some wierd indentation.Quote:
Originally posted by visualAd
Code:<html>
<body>
<form action="test.html" method="post" onsubmit="window.open('http://www.vnn.vn');">
Test input: <input type="text" /><br />
<input type="submit" value="Submit Form">
</form>
</body>
</html>
:lol: gVim goes a bit over the top with its tabs. It looks nice though.
I don't like it that much, since it indents everuthing inside <html> and </html>, the almost whole document will be indented.
I generally don't bother indeting HTML (but I do use line breaks), except tables, and long lists (<li> or <ul>).
JS on the other hand I indent.
I like gVim becuase it auto indents so you don't have to worry. I always use indentation in html - I find it makes it easier to see when you haven't closed a tag.
It can get messy when trying to write PHP scripts though.
http://www.vbforums.com/attachment.p...postid=1669533
OMG. here's an example from my things:
http://www.vbforums.com/attachment.p...postid=1669539
I was put off dreamWeaver at college when we had to use DreamWeaver 4. I couldn't stand it, because it had a habbit or randomly inserting and removing HTML from the source.
I think MX and MX 2003 (which I have on MY PC) still add random code. but only if you use the wysiwug side of the thing. I only use the code view, unless I'm making tables. then it doesn't add random code.