Solved

Frames Questions

Posted on 2000-02-28
12
223 Views
Last Modified: 2010-04-09
Hi guys..........
I have three frames, I want to update the contents of two of the frames,
only when I click a submit buton in one of the frames.
The frame that has the button also has a text entry box, I would like to reset this after submission......
Frame1 has a button and a text box.
Frame2 is empty
Frame3 is empty.
When I click the button in Frame1, I want the contents of the text box aimed at a page in Frame2 AND another page loaded into Frame3 and the contents of the text box
to be reset.
Thanks
0
Comment
Question by:rickyr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
12 Comments
 
LVL 1

Expert Comment

by:estrauss
ID: 2566666
I think a Javascript as follows will do what you want.


function accomplishthis(form)
{
parent.frame2.writeln(form.textboxname.value);
parent.frame3.location.href="whereever";
form.textboxname.value="";
}
<html><form> etc.


<input type="button" value="push me now!" onclick="accomplishthis(this.form)">
0
 
LVL 3

Author Comment

by:rickyr
ID: 2568463
Please describe whats going on, I don't know javascript.
Regards
0
 
LVL 1

Accepted Solution

by:
estrauss earned 50 total points
ID: 2568688
Hi,
   Well, it is actually fairly straightforward, but Javascript, like all computer languages, is pretty picky about syntax so it may not be obvious.

in the <head> region of your page you need to have a javascript function. In the body you have your form and the form calls the function. To fill in a few more details the page looks as shown below. Note that anything on a line preceded by a "//" is a comment in Javascript and I assume that this is written in a frame1 which will be displayed along with frames 2 & 3. There would also be a "parent" page which calls all three frames. It would be possible to set it up other ways.
<html>
<head><title>nameofpage</title>
<Script Language="JavaScript"> //This tells the computer that you are starting a script
  function dothis(form)//starts a function and tells it the input is going to come from a specific form.
  { //defines the beging of the actual commands of the fucntion
parent.nameofframe2.writeln(form.textboxname.value); //"parent.nameofframe2.writeln" specifies that it should write into frame2", "form.textboxname.value" is whatever is in the textbox
parent.nameofframe3.location.href="http://www.q7.com/~ethan"; //"parent.nameofframe3.location.href=" specifies that it should open the location given in frame3, "http://www.q7.com/~ethan" is my page. replace it with the URL you want.
form.textboxname.value=""; //This makes the text in the textbox '""' or blank.
  } //end of this function
</Script> //end of all scripts
</head>
<body>
<form>
<input type=textarea name="textboxname"><input type="button" value="push me now!" onclick="dothis(this.form);//this calls the function above and tells it to use the values from this form">
</body>


I hope that this helps. Setting up something with a bunch of frames is confusing. I don't think that there is a way to do what you want without Javascript or something else which would be even more complex. I think what I have given you above should get you started, but be very careful about the placement of parenthases and quotes!
Ethan
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:rickyr
ID: 2568880
Ethan.....
Can I move the goal posts slightly?
My text box now gets reset! Fine.
I would now like to pass its contents on to another cgi and display the results of that in frame2. In other words, How do I define an ACTION
for (leaving fframe2 as the target?
Thanks for bearing with me.
regards
Ricky
0
 
LVL 1

Expert Comment

by:estrauss
ID: 2568942
I don't know how to deal with the cgi end of things. I assume that you can target the output of the cgi to a specific frame. An option using javascript would be to recieve the results of the cgi and assign them to a variable and then write that variable to the new frame. So it would looks something like:

var text=resultsofthecgi
parent.nameofframe2.writeln(text);

I don't know if that helps or not. Good Luck!
Ethan

0
 
LVL 3

Author Comment

by:rickyr
ID: 2569013
Ethan....................
You do not need to know anything about CGI. You know (in conventional html forms) how you can say
<FORM TARGET=myframename ACTION=my.cgi>
<INPUT> etc.........
</FORM>
well.....
I need to be able to specify an action in the form you supply.
In other words I want to direct the submission of the button we speak of to another web page......also........
I noticed that while my text box is reset, I'm actually getting a javascript error and nothing happens.
Thanks
Ricky
0
 
LVL 1

Expert Comment

by:estrauss
ID: 2569645
Sorry Ricky,
I think you have wandered out of my area of expetise :-( Do you have these pages up on the web somewhere? If you do, I could take a look and see what I can figure out, but I am not sure if I will get anywhere.
Ethan
0
 
LVL 3

Author Comment

by:rickyr
ID: 2572094
Works a treat!
Thanks Ethan.
Incidently how can I get the page to refresh itself
using ALL the existing cgi params that called it in the first place, I tried this with a...
http-equiv=refresh in the <Meta> tag. but this constantly refreshes itself over and over again, I just want this to occur once only.
You don't have to answer if you don't want to, I've graded you anyway, just after a freebee.
Thanks very much for all your help.
Cheers
Ricky
0
 
LVL 1

Expert Comment

by:estrauss
ID: 2572422
I believe you can add

document.location.reload()

to the end of the javascript.

I have never used this, but I think it ought to work.
Ethan
0
 
LVL 3

Author Comment

by:rickyr
ID: 2572689
The page I want refreshed after clicking on its links is not a form, has no scripts, In fact it  I actually want to go back and do a submit on the first frame after I have clicked on the href on frame2.
How can I push another frames button by clicking a href elsewhere
regards
0
 
LVL 3

Author Comment

by:rickyr
ID: 2572734
Or.....
How do I tell a web page that it must ALLWAYS go into a frame called "reply" of window called "view" regardless of the TARGET of the calling form.
regards
0
 
LVL 3

Author Comment

by:rickyr
ID: 2573078
Hmmm.
The popup works (it submits on change)  but the go button gives a javascript error, help.....

----------------------------------------------------
<HTML>
<HEAD>
<title>Assign to Team: AnyMedia web page</title>
<script language="javascript">;
function accomplishthis(form)
{
parent.choose.writeln(form.NAMESTART.value);
parent.main2.location.href="find";
form.NAMESTART.value="";
}
</script>
</HEAD>
<Body bgcolor=#EE9910>
<form name=myform method="GET" action="/assign/find" target="main2">
Search for Advert
<INPUT TYPE="text" NAME="NAMESTART" SIZE=20>
<input type="button" value="Go!" onclick="accomplishthis(this.form)">
<SELECT NAME=Team_Name onchange="document.myform.submit();">
<OPTION VALUE="roysteam">roysteam
<OPTION VALUE="Team One Gothenburg">Team One Gothenburg
<OPTION VALUE="Team One Stockholm">Team One Stockholm
<OPTION VALUE="Team Two Gothenburg">Team Two Gothenburg
<OPTION VALUE="Team Two Stockholm">Team Two Stockholm
</SELECT>
<INPUT TYPE="hidden" NAME=STATUS VALUE="Booked">
<INPUT TYPE="hidden" NAME=TASK VALUE="assign">
</form>
</Body>
</HTML>
---------------------------------------------------------------------------------------
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adding 1 the value of input "text" every 3 seconds 5 47
CSS for <center> 14 47
Hit counters in SharePoint 2013 2 55
Boolean 13 44
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 to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

738 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