473,411 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Open new html page without menubar, ....

Dear all,

I write a following form in the html page and link to the webpage without
scrollbar,menubar, with a fixed size as follow:
-------------------------
<form name="formsearch" method="post" action="/update/search.php"
target="new" onSubmit="return CheckForm2()"><input type="hidden"
name="PHPSESSID" value="f7092b1e7077d992e854d60c797084f9" />
<div valign=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
<b> <font size=1 face="Verdana">Product:</font></b>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;
<input type="text" name="product"value="">
<input type="submit" name="Submit" value="Search">
</div>
</form>
----------------------
and the corresponding javascript
======================
function CheckForm2()
{
if(document.formsearch.product.value==""){
document.formsearch.product.focus();
alert ("Please input product name!");
return false;
}
window.open('this.href','child','scrollbars=yes,me nubars=no,toolbars=no,widt
h=500,height=550')
return true;
}
==============
but the linkage is not valid. Please give me helping hand, thanks

Regards,
Simon



Jul 23 '05 #1
1 1922
Simon Lee wrote:
Dear all,

I write a following form in the html page and link to the webpage without scrollbar,menubar, with a fixed size as follow:
-------------------------
<form name="formsearch" method="post" action="/update/search.php"
target="new" onSubmit="return CheckForm2()"><input type="hidden"
name="PHPSESSID" value="f7092b1e7077d992e854d60c797084f9" />
<div valign=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
<b> <font size=1 face="Verdana">Product:</font></b>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp; <input type="text" name="product"value="">
<input type="submit" name="Submit" value="Search">
</div>
</form>
----------------------
and the corresponding javascript
======================
function CheckForm2()
{
if(document.formsearch.product.value==""){
document.formsearch.product.focus();
alert ("Please input product name!");
return false;
}
window.open('this.href','child','scrollbars=yes,me nubars=no,toolbars=no,widt h=500,height=550')
return true;
}
==============
but the linkage is not valid. Please give me helping hand, thanks

Regards,
Simon


For starters, might as well pass the form's elements[] object to your
function, as onsubmit is a property of it:

<form....onsubmit="return CheckForm2(this.elements)"><...

Then:

function CheckForm2(els)
{
if (els.product.value=="")
{
alert("Please input product name!");
if (els.product.focus)
els.product.focus();
return false;
}

You want to open a window with a blank document, whose name is the same
as the target name in the <form> tag, so - it'll be targeted there.

else
{
window.open(
'about:blank',
'newwin',
'scrollbars=yes,menubars=no,toolbars=no,width=500, height=550'
);
return true;
}
}

<form....target="newwin">

'new' is a tricky word to have around when you're scripting. Best to
avoid it.

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: net | last post by:
I know how to make a page open itself at a certain size and location - I use: <html> <head><script language="Javascript"> window.resizeTo(370,220); window.moveTo(10,10); </script> <meta...
2
by: venkatesh | last post by:
Hi Members, I have used the below mentioned code to open a html page in a new browser. The window size is 200 x 300. In that browser, I've given code to open another browser of the same size....
2
by: Ed Schimmel | last post by:
Hi All, I have a small question considiring the opening of a new window in javascript. As you all know the code below will open a new without any bars. But when I tried this code in IE6 it won't...
7
by: Merlin | last post by:
Hi there, I have a problem with opening new windows with JS. If the webpage did not complete loading due to any reason a click on a link which is supposed to open a small new other window loads...
3
by: unurban | last post by:
I have a javascript menu based off of unordered lists that only shows the subnav links when you click on the main nav links. is there a way to keep any subnav items open after you click on a link...
11
by: Dave | last post by:
For some reason, the below lines only work on select machines. All machines are running IE6. IE SP's and OS's vary. When it doesn't work, default.aspx (the page that this code is in) opens and...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
1
by: Merlin Morgenstern | last post by:
Hi there, I do have a JS-function that does open windows in a specific format to display small pices of information, like member comments. Since a while I have found that this will not work on...
13
by: PaPa | last post by:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1- transitional.dtd"> <html lang="en"...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.