Solved

opening new window ?

Posted on 2001-06-12
25
204 Views
Last Modified: 2010-08-05
Friends,

my default.asp has left frame,frame name=links and a right frame,frame name=main.The left frame has links all of which are targeted to the right frame.
When I click on the link for 'Any comments or suggestions' in the left frame,it displays a storeComments.html in the main frame. and when the user submits, the same frame shows the asp that adds the comment and shows all the comments till date.
but next time when i click on the same link in the left frame , instead of opening the storeComments.html in the main frame , it opens the html in new window.Why ??

Thanks ...
0
Comment
Question by:babashri
  • 9
  • 7
  • 2
  • +7
25 Comments
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6182395
Hi babashri....before I help you with this question, how about doing me the courtesty of coming back to your old questions and either closing it or providing some feedback???

Thanks!
0
 

Author Comment

by:babashri
ID: 6182738
ClassyLinks ,for this section of 'HTML' , i think i have attended all the questions , and about the questions from the other sections , i would take some few days to actually accept the answers because i have to check whether they come to my expectations.

Thanks ..
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6182752
Just asking that you don't forget about them....


In any case, please post the code for your offending href....is there a target specified for that link?  Or is there a default target for the frame?
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6183261
Indeed we will need to see the code...or even better a link to the page in question....but my guess is that the page has lost it's objects....this happens a lot in Netscape when parts of the code are not properly closed...also on resize it will happen...

At least it has lost its reference to the object that is in this case the framename, therefor thinking the frame doesn't exist, the browser thinks you meant to open a new window with that name...

Cheers,
Max.
0
 

Author Comment

by:babashri
ID: 6183478
My default.asp is as follows :

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<LINK rel="stylesheet" href="common/siteStyle.css" type="text/css">
</HEAD>
<FRAMESET rows="80,*" framespacing=0 frameborder=0>
<FRAME src="content/banner.html" name="banner" scroll="off">
<FRAMESET cols="20%,*" >
<FRAME src="content/links.asp" name="links" scroll="off">
<FRAME src="content/main.html" name="main">
<NOFRAMES>
<BODY>
<p> Sorry Man !! Your Browser doesn't suppoert Frames !!
</BODY>
</NOFRAMES>
</HTML>


my links.asp is as follows :

<%@ language=VBScript%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<LINK rel="stylesheet" href="/common/siteStyle.css" type="text/css">
<TITLE></TITLE>
</HEAD>
<body><p><p>
<A href="history.html" target=main>History</A>
<p><A href="co-curricular.html" target=main>Co-Curricular Activities</A>
<p><A href="notice-board.html" target=main>Notice Board</A>
<P><A href="paststudents.html" target=main>Past Students Association
<P><A href="principal.html" target=main>Principal's Message</A></P>
<p><A href="guestbook.asp" target=main>Guest Book</A><p>
<p><A href="storeComments.html" target=main>Any Comments or Suggestions</A>
<p> You are <%=Application("hit_count")%>th Visitor
</body>
</HTML>


my storeComments.html is as follows :

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<style type="text/css">
td {color:#a52a2a;font-family:Verdana;font-weight:bolder;font-size:smaller}
</style>
</HEAD>
<BODY>
<table width=80%>
<tr><td >Comments / Suggestions</td></tr>
<tr><td>
<form name=myform method=post action="storeComments.asp" onSubmit="return Validate_form(this)">
<TABLE cellSpacing=1 cellPadding=1 width="100%">
  <TR>
    <TD>Name </TD>
    <TD><INPUT id=text1 name=txtName></TD></TR>
  <TR>
    <TD>Email Address</TD>
    <TD><INPUT id=text2 name=txtEmailAddress></TD></TR>
  <TR>
    <TD align=top>Comments </TD>
    <TD><TEXTAREA id=TEXTAREA1 name=txtComments maxlength=200 rows=15 cols=60 ></TEXTAREA></TD></TR>
  <TR colspan=2>
    <TD><INPUT type=submit value=Submit name=submit1 ></TD>
  </TR>
  <TR>
     <TD colspan=2><A href="storeComments.asp?option=VIEW_ONLY">
     <font face="Verdana" size="1" color="#a52a2a">View Comments/Suggestions</font></A></TD>
  </TR>
</TABLE>
</form>
</td></tr>
</table>
</BODY>

thats it .. if some more details required i would paste further...

thanks
0
 
LVL 9

Expert Comment

by:nimaig
ID: 6184559
Try closing the all opened <FRAMESET> tag. Maybe this would help you.

i.e.
<FRAMESET rows="80,*" framespacing=0 frameborder=0>
    <FRAME src="content/banner.html" name="banner" scroll="off">
   <FRAMESET cols="20%,*" >
      <FRAME src="content/links.asp" name="links" scroll="off">
     <FRAME src="content/main.html" name="main">
   </FRAMESET>
</FRAMESET>
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6184843
Yes...that would most likely cause a loss of framenames...

It could also give you different problems...like no results at all in Netscape...since Netscape is a little bit more strict with code...

Max.
0
 

Author Comment

by:babashri
ID: 6186678
Yes i had changed my default.asp as follows :

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<LINK rel="stylesheet" href="common/siteStyle.css" type="text/css">
</HEAD>
<FRAMESET rows="80,*" framespacing=0 frameborder=0>
<FRAME src="content/banner.html" name="banner" scroll="off">
<FRAMESET cols="20%,*" >
<FRAME src="content/links.asp" name="links" scroll="off">
<FRAME src="content/main.html" name="main">
</FRAMESET>
</FRAMESET>
<NOFRAMES>
<BODY>
<p> Sorry Man !! Your Browser doesn't suppoert Frames !!
</BODY>
</NOFRAMES>
</HTML>

but its not working still, its opening a new window when i click the 'Comments/Sugestions' link for the second time.
For the first click it shows in the main frame but further clicks open a new window....

0
 
LVL 3

Expert Comment

by:yas022100
ID: 6188771
I have experienced something like that, except I had three frames A,B,C.
B is a menu frame and change the content of C, every menu href in frame B has target=C, so when user clicks on menu on frame B, contents shows up on Frame C. This works well in normal fasion, but If I ever create Popup Window on frame C, frame B start creating new window instead of putting the contents to frame C.  This was very strange... I did not get a solution, so I gave up showing popup on frame c.
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6189623
Does this happen in all browsers?

I have just copyed all your pages (as you posted them here in the question) into my browser (IE 5.5) and I have no problems....is there perhaps something wrong with your other pages...is any of the links in the links.asp calling a page which contains of another frameset?

Please show more of the pages...or better yet post a link to where we can view it online...

If this cannot be done it would be fine if you send it to me by email... (david315@wxs.nl).

This simply has to be a minor mistake...please also mention the browser you are watching this with...

Max.
0
 

Expert Comment

by:WebMaker
ID: 6190222
Try adding the following in the Head section of links.asp

<base target="main">

Then remove the target from all the links that point to "main".

0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6190238
That's not going to help WebMaker....but it's always nice to have just one target instead of 10.... :-)

Max.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:babashri
ID: 6196154
I will tell you all more about the problem :

when i click on the links, they get opened in the main frame until when i submit the form in the storeComments.html i.e. when the storeComments.asp is called . After this point whenever i click on any of the links in the links.asp in the links frame,all the links are opened in the new window.
In short when i submit the form in the storeComments.html, then the problem starts ...

0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6196430
Then show us storeComments.html and storeComments.asp please....so we can have a look what might cause this....

Max.
0
 

Author Comment

by:babashri
ID: 6196646
yes i am showing the storeComments.html.
I have found the area of problem , but not getting whats the problem in that area .

storeComments.html :

In the Validate_form(form) function if the first statement is simple 'return true' , then it works i.e. no new window is shown for a click on a link in the links.asp , but if its removed (commented) then a new window is opened for the clicks on the links in the links.asp

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<style type="text/css">
td {color:#a52a2a;font-family:Verdana;font-weight:bolder;font-size:smaller}
</style>
</HEAD>
<BODY>
<table width=80%>
<tr><td>Comments / Suggestions</td></tr>
<tr><td>
<form name=myform method=post action="storeComments.asp" onSubmit="return Validate_form(this)">
<TABLE cellSpacing=1 cellPadding=1 width="100%">
  <TR>
    <TD>Name </TD>
    <TD><INPUT id=text1 name=txtName></TD></TR>
  <TR>
    <TD>Email Address</TD>
    <TD><INPUT id=text2 name=txtEmailAddress></TD></TR>
  <TR>
    <TD align=top>Comments </TD>
    <TD><TEXTAREA id=TEXTAREA1 name=txtComments maxlength=200 rows=15 cols=60 ></TEXTAREA></TD></TR>
  <TR colspan=2>
    <TD><INPUT type=submit value=Submit name=submit1 ></TD>
  </TR>
  <TR>
     <TD colspan=2><A href="storeComments.asp?option=VIEW_ONLY">
     <font face="Verdana" size="1" color="#a52a2a">View Comments/Suggestions</font></A></TD>
  </TR>
</TABLE>
</form>
</td></tr>
</table>
</BODY>
<script language=Javascript>
function Validate_form(form)
{
 // return true  
 // if the above line is uncommented then it works fine
 // but if commented it doesn't work
 valid = true
 names = new Array(3)
 
 name = form.txtName.value
 emailAddress = form.txtEmailAddress.value
 comments = form.txtComments.value
 // check that the name field is not left blank
 if(isBlank(name))
          {
               window.alert("Please put valid name")
               form.txtName.focus()
               return(valid=false)
          }
 return valid          
 }
 
 function isBlank(control_value)
{
 
    blank = (control_value.length > 0 ) ? false : true ;
     for(index=0;index<control_value.length;index++)
        if(control_value.charAt(index) != ' ' )
          {
            blank = false    
            break;
         }  
         else
           blank = true
   return blank          
}          
</script>    
</HTML>
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6196655
The return true is indeed needed...

Never post a form using javascript without using return true....

return true makes sure the page will not change and references are not lost when you post the form...

I should have known this would be the problem you were facing...

Cheers,
Max.
0
 

Author Comment

by:babashri
ID: 6196930
But DreamMaster, I have the first statement in the Validate_form(form) function as, valid=true ,
and when some conditions are false then valid=false,
so allways its either true or false.
The last return valid statement will allways return true.
So i think thats not the exact problem..
0
 

Author Comment

by:babashri
ID: 6206836
I am increasing the points to 50
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6219046
Monitoring for progress here.

Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 19

Accepted Solution

by:
DreamMaster earned 50 total points
ID: 6223930
Try setting true or false for return values the normal way...I've seen it go wrong when using variables....

Sorry it took a while to respond...I was on vacation...

Max.
0
 

Expert Comment

by:teacher_mod
ID: 6374489
This question has been abandoned. Would the experts please indicate how
this should be closed out. Is there a comment which should be accepted?
Should the points be split? Should it be reduced to zero points and PAQed?
should it be deleted?  In the absence of direction, the default will be
for me to delete.

TIA for helping to clean up the old questions.

teacher_mod
Community Support Moderator
Experts-Exchange
teacher_mod@experts-exchange.com


0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6375956
Well...I was still waiting for response on my last suggestion....

Max.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6520087
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
Points to DreamMaster

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 6521638
awarding to DreamMaster
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6522492
Thanks kodiakbear... :)

Max.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now