View Full Version : html + javascript (changing frames from form)

11-10-2010, 04:05 PM
CHANGE zero in c0m to O becoming com


first an example of what im trying to do:
when logging in to a forum, you enter your info at the top right corner. thts where the login info txt boxes are usually located. under these you'll find a menu bar. if you're logged in, the menu commands/items arent the same as when you're not logged in. example of logged in is search. example of not being logged in is register. anyways under the menu there's the forum itself. u no, sections and topics. the table basically.
this is wht im trying to do. even if im doing it wrong plz indulge me I know that ppl dont use frames much anymore. but just go with it. It DOES help to no how to do something in different ways.

Ok, assuming you setup my pages, press submit. All 3 frames SHOULD go to 1.php BUT what happens is that the lower two frames go to 1.php. the first frame doesnt. It's the frame that has the form which has the button. If i put the button outside the form and press submit, it works. all 3 frames change. so i'm guessing it's got to do with the form itself.

How do I fix it?

Thank you!!!!

11-12-2010, 07:48 PM
69 views and no one'sbothered to reply? at least tell me the links arent working or something. seriously 69 views and no one can help me??????? whts up with that.

Old Pedant
11-12-2010, 09:43 PM
Sorry, but first of all you give us a link that isn't a link. So we have to muck with changing the url. And than all that url does is take us to a page where we can download a zip file. So you first of all make it hard to find the zip file and then you expect us to download it, unzip it (hoping it doesn't have a virus), and analyze your code.

On top of that, you say the code is PHP. And not all of us use PHP (I certainly don't). So you make us wonder if the question even belongs in the JavaScript forum.

Couldn't you just show us the page live, online? Or copy/paste the relevant fragments of code here?

11-14-2010, 02:25 AM
thank you! i thought pasting the ocde here but there are several pages and i didnt think any1 would bother pasting every piece on a diff html file :D
i will get right on it. but ty. now tht i no whts wrong i can fix it here and in others as well.

11-14-2010, 02:30 PM
Here is the code


<html xmlns="http://www.w3.org/1999/xhtml">
<title>Frames Example 5</title>
<frameset rows="20%,20%,80%">
<frame src="logintable.php" name="top_frame" id="top_frame" />
<frame src="menubar.php" name="middle_frame" id="middle_frame" />
<!--<frame src="profileframe.php" name="bottom_frame" id="bottom_frame" />


<script language="JavaScript" type="text/javascript">
function change2()
<form name="log">
<input name="go" type="submit" value="Submit" onclick="javascript:change2()"/>


so if u run this you'll see that the second row goes to 1.php but not the first one. this is wht im trying to solve. i hope this helps. ty.