New to "complex" html but this *should* be easy...?

T

Tym

OK... I've been dabbling with a bit of HTML over the years, keeping it
pretty simple.... Now I've got adventurous, and with it, a problem...

I have two frames... FrameA and FrameB

In Frame A I have a form which passed data to a PHP script and displays the
result. However, I want to force it to display the results in FrameB, not to
the originating FrameA, reloading a blank for im FrameA as it does...

How do I achieve this please?

Tym
 
M

mrcakey

Tym said:
OK... I've been dabbling with a bit of HTML over the years, keeping it
pretty simple.... Now I've got adventurous, and with it, a problem...

I have two frames... FrameA and FrameB

In Frame A I have a form which passed data to a PHP script and displays
the result. However, I want to force it to display the results in FrameB,
not to the originating FrameA, reloading a blank for im FrameA as it
does...

How do I achieve this please?

Tym

I think I probably misunderstand your difficulty. Surely if you display
your PHP page in frame B that's your problem over?

BTW, frames are very naughty. You'll get a spanking off the frame fairy if
you persist:

http://en.wikipedia.org/wiki/Framing_(World_Wide_Web)#Criticism

+mrcakey
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Thu, 21 Feb 2008 07:47:11
GMT Tym scribed:
OK... I've been dabbling with a bit of HTML over the years, keeping it
pretty simple.... Now I've got adventurous, and with it, a problem...

I have two frames... FrameA and FrameB

In Frame A I have a form which passed data to a PHP script and
displays the result. However, I want to force it to display the
results in FrameB, not to the originating FrameA, reloading a blank
for im FrameA as it does...

How do I achieve this please?

Have the script update the "B" page and then reload the frameset.
 
T

Tym

mrcakey said:
I think I probably misunderstand your difficulty. Surely if you display
your PHP page in frame B that's your problem over?


No, you undertand ( i said it was easy) I just don't know how to do it.

On loding the frameset, FrameA contains the form, and FrameB is blank. When
the user clicks submit on FrameA, I want FrameA to re-display an empty form,
and the PHP page it is sent to display the results in FrameB. I can get it
all to work in the same frame, but that's not the effect I'm aiming for.

I know this is probably very basic stuff, but I've not done this before so
would appreciate an idiot's guide to what HTML I should be implmenting.

Tym
 
T

Tym

Neredbojias said:
Well bust mah britches and call me cheeky, on Thu, 21 Feb 2008 07:47:11
GMT Tym scribed:
Have the script update the "B" page and then reload the frameset.

As I've said in my other response, this is exactly what I'm trying to
acheive but don't know the necessary HTML to implement it.
 
J

Jeff

Toby said:
The "target" attribute on the <form> element is your friend.

Nobody here likes frames. Toby is just nicer than the rest of us!

I believe that you'll want to reload the frameset and I think that
target is _top. If you have nested framesets the parent is tadah: parent_

I had a client that loved frames. If I never see another I won't be
disappointed.

Jeff
 
M

mrcakey

Jeff said:
Nobody here likes frames. Toby is just nicer than the rest of us!

I believe that you'll want to reload the frameset and I think that target
is _top. If you have nested framesets the parent is tadah: parent_

I had a client that loved frames. If I never see another I won't be
disappointed.

Jeff

Could OP not also have his form point to a PHP script that drew the whole
frameset out again?

Frames do suck, but they also give me a warm "aah, remember the 90s when I
was thin" feeling.

+mrcakey
 
J

Jeff

Jeff said:
Nobody here likes frames. Toby is just nicer than the rest of us!

I believe that you'll want to reload the frameset and I think that
target is _top. If you have nested framesets the parent is tadah: parent_


Well, I just learned something new. How to underline in plain text.
Those targets are underscore top and underscore parent.


Just look it up.

Jeff
 
C

C A Upsdell

Toby said:
The "target" attribute on the <form> element is your friend.

Yes, this is a solution. The target attribute can be used within a FORM
tag to do what the OP wants.
 
T

Tim Streater

Jeff said:
Nobody here likes frames. Toby is just nicer than the rest of us!

I like and use frames and iframes. As I have stated before, my app
doesn't scale without iframes. Unless you expect my users to deal with
<selects>'s that contain thousands of values, of course.
 
J

Jeff

Tim said:
I like and use frames and iframes. As I have stated before, my app
doesn't scale without iframes. Unless you expect my users to deal with
<selects>'s that contain thousands of values, of course.

Yes, that is one of the better reasons to have frames, but you are
still reloading frames. Few users (outside this group) turn off
javascript and there are a number of ways to build dynamic select lists.
And once loaded, they don't have to be reloaded.

Jeff
 
T

Tim Streater

Jeff said:
Yes, that is one of the better reasons to have frames, but you are
still reloading frames. Few users (outside this group) turn off
javascript and there are a number of ways to build dynamic select lists.
And once loaded, they don't have to be reloaded.

I should point out that there are 100 users, tops, of these pages
(password protected). I use iframes thus:

first <select> - is loaded with a list of locations (about 200) where we
have equipment (from a mysql db)

second <select> - is loaded with the equipment at the location chosen by
the user from the first select (about 20 items, typically). The <select>
is in an iframe, loaded dynamically

third <select> - is loaded based on the equipment chosen by the user
from the second select. It represents interface cards within the
equipment (again, up to 20 items typically). The <select> is in an
iframe and is loaded as the previous one.

All this times two because what the user is actually doing, is defining
a path between two points on our network.

When all this was a few items of each, I just loaded all combinations
and used some js to present the proper items. No iframes. When it
reached a few hundred k of js to be downloaded, and I was told the whole
thing was going to get much bigger, is when I started using iframes as
it clearly was not going to scale.

I am curious to know if there is an alternative approach which:

1) scales
2) does not involve reloading the whole page (naff in the extreme)
3) satisfies the "no frames or iframes" requirement :)

MY successor (I am retiring in 6 months) will be the one, in any case,
to implement any changes of the scale required.

I'm looking at used cars at the moment of www.autotrader.co.uk and their
search area looks nice but I can't deduce the general techniques in use
(other than lots of js).
 
J

Jeff

Tim said:
I should point out that there are 100 users, tops, of these pages
(password protected). I use iframes thus:

first <select> - is loaded with a list of locations (about 200) where we
have equipment (from a mysql db)

second <select> - is loaded with the equipment at the location chosen by
the user from the first select (about 20 items, typically). The <select>
is in an iframe, loaded dynamically

third <select> - is loaded based on the equipment chosen by the user
from the second select. It represents interface cards within the
equipment (again, up to 20 items typically). The <select> is in an
iframe and is loaded as the previous one.

All this times two because what the user is actually doing, is defining
a path between two points on our network.

When all this was a few items of each, I just loaded all combinations
and used some js to present the proper items. No iframes. When it
reached a few hundred k of js to be downloaded, and I was told the whole
thing was going to get much bigger, is when I started using iframes as
it clearly was not going to scale.

I am curious to know if there is an alternative approach which:

1) scales
2) does not involve reloading the whole page (naff in the extreme)
3) satisfies the "no frames or iframes" requirement :)

You could AJAX it, run the data as JASON. That should be faster than
your IFRAMES as you are just downloading an array rather than the whole
option list.

Jeff
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Thu, 21 Feb 2008 09:18:46 GMT
Tym scribed:
As I've said in my other response, this is exactly what I'm trying to
acheive but don't know the necessary HTML to implement it.

Uh, yeah, I guess you're right.

Anyway, I "whipped up" (-rolls eyes) an example at this link:

http://www.neredbojias.com/fram1/fr_0.php

If you like it, I'll post the code/markup parts that don't show.
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Thu, 21 Feb 2008 22:32:30
GMT Tym scribed:
That's perfect! gizza clue? ;-) please!

....Here's the source for the frameset page, fr_0.php:

<?
if ($_POST['impic']) {
$chpic = "?pic=" . $_POST['impic'];
} else {
$chpic = "?pic=dblon";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Frameset Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="author" content="Neredbojias">
<link rel="icon" href="../nerbo.ico" type="image/x-icon">
</head>

<frameset cols="50%,50%">
<frame src="fr_1.php<? echo $chpic; ?>" name="fr1">
<frame src="fr_2.php<? echo $chpic; ?>" name="fr2">
</frameset>

</html>


....Here's what you might call the "nav" page, fr_1:

<?
$ch1="";$ch2="";$ch3="";$ch4="";
if ($_GET['pic'] === "dbald") {
$ch4 = " checked";
} elseif ($_GET['pic'] === "dredh") {
$ch3 = " checked";
} elseif ($_GET['pic'] === "dbrun") {
$ch2 = " checked";
} else {
$ch1 = " checked";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Pic-A-Pic</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="author" content="Neredbojias">
<style type="text/css">
body {
margin:4px 12px 12px;
padding:0;
background:#7c6870;color:#e8d8d4;
font-family:sans-serif;
}
h3 {
margin-top:0px;
}
#ct1 {
line-height:1.4;
font-size:110%;
}
form {
margin:0;
}
input {
margin-left:0;
}
..cu {
margin:.5em 0;
padding:0;
font-family:Helvetica,Arial,sans-serif;
font-size:83%;
font-weight:bold;
}
</style>
</head>

<body>

<h3>Pic-A-Pic</h3>

<div id="ct1">
<br>
Choose your Image:
<br>
<form method="post" action="fr_0.php" target="_top">
<div>
<br>
<input type="radio" name="impic" value="dblon"<? echo $ch1; ?>> Blond<br>
<input type="radio" name="impic" value="dbrun"<? echo $ch2; ?>> Brunette
<br>
<input type="radio" name="impic" value="dredh"<? echo $ch3; ?>> Redhead
<br>
<input type="radio" name="impic" value="dbald"<? echo $ch4; ?>> Bald<br>
<br>
<input type="reset" value="Clear" class="cu">
<input name="smit" type="submit" value="Submit" class="cu">
</div>
</form>
</div>

<script type="text/javascript">

</script>

</body>
</html>


....And here's the pic page, fr_2:

<?
if ($_GET['pic'] === "dbald" || $_GET['pic'] === "dredh" || $_GET['pic']
=== "dbrun") {
$pic = $_GET['pic'] . ".jpg";
} else {
$pic = "dblon.jpg";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="author" content="Neredbojias">
<title>Pic-A-Pic Image</title>
<style type="text/css">
html,body {
height:100%;
overflow:auto;
}
body {
margin:0;
padding:0;
text-align:center;
background:#7c6870;color:#e8d8d4;
line-height:0px;
font-size:0px;
}
table {
margin:auto;
height:100%;
border:0;
}
</style>
</head>

<body>

<table cellspacing="0" cellpadding="0"><tr><td align="center"><img
src="<? echo $pic; ?>" alt=""></td></tr></table>

</body>
</html>


Happy coding!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top