PDA

View Full Version : I am having trouble getting this form processor to open into another frame.



tnfezda
12-15-2004, 02:29 PM
Okay, to let you know alittle about the site that this is for.

This script belongs to a Fantasy Football League which my ex boss created. He has been having problems creating the site due to him being brand spanking new to creating. I mean he has been using Yahoo to build it at first. His main site consists of 3 frames. A top banner, a left sided frame mainly full of links and navigational stuff, and the main frame which is for the loaded pages. He has a list box with links in it that he wants to load into the main frame. We both have no clue when it comes to Java Script, but I have alittle more edge than him. I have posted the whole script for the list box. I know the problem is in the form processor but I don't know enough to firgure it out. He got the script from a help site but he can't remember which one. I have tryed to figure it out by learning what each command means, but the books I have doesn't go into that much detail. Any help would be helpful. If you need a link to the actual site, email me at fez at jjstechnology dot com



<tr>
<td width="100%" align="center" height="19">
<font color="#FF8000">
<!--webbot bot="HTMLMarkup" startspan --><SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</SCRIPT>

<center>
<form name="form" target="main">
<select name="site" size=1 onChange="javascript:formHandler()">
<option selected>Select a Position


<option value="http://www.chode.com/quarterbacks.htm">Quarterbacks
<option value="http://www.chode.com/running_backs.htm">Running Backs
<option value="http://www.chode.com/wide_receivers.htm">Wide Receivers
<option value="http://www.chode.com/tight_ends.htm">Tight Ends
<option value="http://www.chode.com/kickers.htm">Kickers
<option value="http://www.chode.com/linebackers.htm">Linebackers
<option value="http://www.chode.com/cornerbacks.htm">Cornerbacks
<option value="http://www.chode.com/safeties.htm">Safeties
<option value="http://www.chode.com/linemen.htm">Linemen

</select>
</form>
</center>

<!--webbot bot="HTMLMarkup" endspan --></font></td>
</tr>

Mr J
12-15-2004, 04:48 PM
Please try the following



<SCRIPT LANGUAGE="JavaScript">
<!--
function formHandler(){
var URL = document["myform"]["site"].options[document["myform"]["site"].selectedIndex].value;
parent.main.location = URL;
}
//-->
</SCRIPT>

<center>
<form name="myform">
<select name="site" size=1 onChange="formHandler()">
<option selected>Select a Position
<option value="http://www.chode.com/quarterbacks.htm">Quarterbacks
<option value="http://www.chode.com/running_backs.htm">Running Backs
<option value="http://www.chode.com/wide_receivers.htm">Wide Receivers
<option value="http://www.chode.com/tight_ends.htm">Tight Ends
<option value="http://www.chode.com/kickers.htm">Kickers
<option value="http://www.chode.com/linebackers.htm">Linebackers
<option value="http://www.chode.com/cornerbacks.htm">Cornerbacks
<option value="http://www.chode.com/safeties.htm">Safeties
<option value="http://www.chode.com/linemen.htm">Linemen

</select>
</form>
</center>

tnfezda
12-15-2004, 06:22 PM
Thank you very much Mr. J. it worked like a charm.
BTW, you wouldn't be related to Mr. T. now would you.......LOL

Thanks again,
Fez

Mr J
12-15-2004, 08:19 PM
Glad to be of help.

I would do away with the borders on the frames though and amend the contents of the left frame so that you do not get the horizontal scrollbar