Google Answers Logo
View Question
 
Q: Web programming - Script for window control (Java? ASP?) ( Answered 5 out of 5 stars,   3 Comments )
Question  
Subject: Web programming - Script for window control (Java? ASP?)
Category: Computers > Programming
Asked by: krickles-ga
List Price: $75.00
Posted: 20 Mar 2003 18:33 PST
Expires: 19 Apr 2003 19:33 PDT
Question ID: 178971
Scenario:  

I am upgrading an intranet app and need a chunk of code to handle a
specific window action.  The log-in page (index.htm) has one field and
a submit button.  The action= page is an ASP page that requires the
info from the index.htm field.  Currently, when SUBMIT is clicked, the
window loads the ASP page.

Need:

To load the ASP page in the original (parent/focus) window, but limit
the window controls to just scrollbars.  I don't want a popup window.

Summary:

Please supply a code chunk that will allow me to load a new page in
the open window while also limiting the window controls to just
scrollbars.  The page that will load is an ASP page.

Misc:

I will supply the code I am using if needed.  Please advise.

Request for Question Clarification by studboy-ga on 20 Mar 2003 19:42 PST
I need the original index.htm and/or a pointer to your website--
have you tried using target=_parent, etc.?
Also I don't quite understand you you meant by "limiting window
controls to scrollbars"?  I thought this ASP code loads in a new
browser window--the scrollbar will be there if the presented materials
is larger than the default window.

Clarification of Question by krickles-ga on 20 Mar 2003 20:15 PST
Index.htm:

</HEAD>
<BODY>

<TABLE border="0" bgcolor="red" width="100%" height="50">
<TR>
<TD>
<Font size="6" color=White>
Sherman Pursuit
</Font>
</TD>
</TR>
</TABLE>

<TABLE border="0" bgcolor="black" width="100%" height="5">
<TR>
<TD>
</TD>
</TR>
</TABLE>

<BR>

<TABLE width="65%" cellspacing="0" cellpadding="3" border="0"
align=center valign=center>
<TR>
<TD width="40%" align=right>
<Font size="4" face=bold>
Please select a division:
</Font>
</TD>
<TD>
<FORM action="home.asp" method=POST id="home" name="home">
<SELECT id="division" name="division">
<OPTION selected>Click arrow for choices...</OPTION>
<option>Area</option>
<option>East</option>
<option>Montgomery</option>
<option>North</option>
<option>North Central</option>
<option>Twin City</option>
<option>------------------------------------</option>
<option>RESET</option>
</SELECT>
&nbsp;
<INPUT type="submit" value="LOG IN" id="login" name="login"
style="WIDTH: 75px; HEIGHT: 24px">
</TD>
</TR>
</FORM>
</TABLE>

<P>&nbsp;</P>

</BODY>
</HTML>

------------------------------------------------------

My form action="home.asp" and method="post" so I can send the value to
the ASP page.  However, when the user clicks the submit button, I want
the home.asp page loaded into the same window of the index.htm.  No
problem until I try to control the features of the window.  I don't
want any window control (e.g., back/forward button, address bar, menu
choices) displayed except for the scrollbars.  I can do this in a
popup window but don't know how to do so in this scenario.

Regards,

Krickles

Request for Question Clarification by studboy-ga on 20 Mar 2003 20:49 PST
Hi

Two parts to your question--two answers:

1) To make your asp load into same windows--use target="_self", ie:

<FORM action="home.asp" target="_self" method=POST id="home"
name="home">

2) Because you are making it appearing in the same window, there's no
way to wipe out the buttons, menus, etc.  Of course you will still get
the scrollbar.

Let me know if this answer your question so I can post a formal answer
for you.  Thanks!

Clarification of Question by krickles-ga on 21 Mar 2003 06:00 PST
I like the idea of opening a popup window and then closing the parent.
 I have no idea how to do this, please provide instructions.

BTW, I don't have to worry about a popup stopper b/c our IT department
locks down all work stations and has the same image on all of them
(which doesn't include a popup stopper).  No one can install anything
on their own machine.

Thanks in advance.  Regards,  KRickles

Request for Question Clarification by studboy-ga on 21 Mar 2003 10:10 PST
Alright, can you give this a try and let me know?

<INPUT type="submit" value="LOG IN" id="login" name="login"
style="WIDTH: 75px; HEIGHT: 24px"
onClick="window.open('home.asp','PopupWindow','toolbar=no,scrollbars=yes');self.close()">

Thanks

Request for Question Clarification by studboy-ga on 21 Mar 2003 10:12 PST
BTW, I can install PopupStopper without admin rights.  Also, I can
disable Javascript on my browser without admin rights.  I do it all
the time myself (since personally I despise popups :)

Request for Question Clarification by studboy-ga on 21 Mar 2003 10:28 PST
Also, note that when you start using Javascript you have to watch
browser compatibilities carefully.  And also, in IE, for security it
will prompt you if you want to close a window that is manually opened
by you.  Javascript is annoying IMO.

Clarification of Question by krickles-ga on 21 Mar 2003 11:45 PST
Perfect!  Thanks so much for the help.  KRickles
Answer  
Subject: Re: Web programming - Script for window control (Java? ASP?)
Answered By: studboy-ga on 21 Mar 2003 12:08 PST
Rated:5 out of 5 stars
 
Thanks krickles-ga.  Here's just a repeat of what we discussed.

target="_self" can be used to open a page in the same window.
However, to faciliate scrollbar only flexibility, the client would 
like to have a popup and then close the parent window.  Thus:

<INPUT type="submit" value="LOG IN" id="login" name="login" 
style="WIDTH: 75px; HEIGHT: 24px"
onClick="window.open('home.asp','PopupWindow','toolbar=no,scrollbars=yes');self.close()">

does the trick.
krickles-ga rated this answer:5 out of 5 stars and gave an additional tip of: $10.00
Great job.  Appropriate questions to narrow down to what I needed. 
Work perfectly as described.

Comments  
Subject: Re: Web programming - Script for window control (Java? ASP?)
From: yourtech-ga on 21 Mar 2003 00:27 PST
 
You cannot change an existing window's controls.  However, you CAN
disable the "back" button in a round-a-bout way...  Use JavaScript to
cancel the change of page and have the script sit in the
"unload=yourscript();" element of the <BODY> tag.

The "yourscript()" function should check to see what is causing the
page change and if it's not what you want, then do a "history.go(0);"
or similar.  I hope this helps!
Subject: Re: Web programming - Script for window control (Java? ASP?)
From: yourtech-ga on 21 Mar 2003 00:49 PST
 
Thought I'd add another idea.

Why not pop a new window with the controls you want, load the page you
want in it and then close the "_parent" window?  That'd get you the
same result.  In fact, I've done that on some of my own sites.
Subject: Re: Web programming - Script for window control (Java? ASP?)
From: studboy-ga on 21 Mar 2003 02:03 PST
 
Popping up a new window and closing the _parent is a good idea but
faces the danger of some users disabling popups (via Popup Stopper or
otherwise, or disabling of Javascripts by the user).

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy